[LDPartEditor] First Alpha Version News (until 2014-09-19)


[LDPartEditor] CSG - A more complex example with DAT source code
#59
[Image: csg_complex_example.png]
Code:
0 // CSG commands can be used in subfiles, too
0 // The identifiers are non-global and bound to the file / subfile

0 // It is possible to inline CSG commands from subfiles

0 BFC CERTIFY CCW

0 // SYNTAX 1 0 !LPE [CSG FORM] [ID] [COLOUR] [MATRIX]
0 !LPE CSG_CUBOID    a  4 0 0 0 1 0 0 0 1 0 0 0 1
0 !LPE CSG_ELLIPSOID b  1 0 0 0 1.35 0 0 0 1.35 0 0 0 1.35

0 !LPE CSG_CYLINDER  c  2 0 -1 0 .7 0 0 0 2 0 0 0 .7
0 !LPE CSG_CYLINDER  d  2 -1 0 0 0 2 0 .7 0 0 0 0 .7
0 !LPE CSG_CYLINDER  e  2 0 0 -1 .7 0 0 0 0 .7 0 2 0

0 // SYNTAX 2 0 !LPE [CSG FUNCTION] [ID] [ID2] [ID3]

0 !LPE CSG_UNION c d d
0 !LPE CSG_UNION d e d
0 !LPE CSG_INTERSECTION a b f
0 !LPE CSG_DIFFERENCE f d f

0 // SYNTAX 3 0 !LPE CSG_COMPILE [ID]
0 // The COMPILE command displays the CSG volume on the screen
0 // Inlining the following line will generate triangles of the CSG volume
0 !LPE CSG_COMPILE f

0 // E.g.
0 // Inlined: !LPE CSG_COMPILE f
3 4 -10 1.5752766 7.3133416 -10 1.5752766 8.313231 -10 3.3930404 7.6749177
3 4 -10 1.5752766 7.3133416 -10 -2.6084895 6.481139 -10 -2.6084895 7.9504156
3 4 -10 1.5752766 7.3133416 -10 -2.6084895 7.9504156 -10 9.094947E-16 8.866396
...

edit: Adjusted transformation matrix syntax to LDraw standard
edit2: changed !LD_PART_EDITOR meta command to !LPE


Attached Files
.dat   inlined_csg.dat (Size: 116.18 KB / Downloads: 0)
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Deadline Change - by Nils Schmidt - 2012-12-25, 11:19
Re: Deadline Change - by Philippe Hurbain - 2012-12-25, 14:30
First Alpha Screenshots - by Nils Schmidt - 2012-12-27, 19:00
Grid implementation done - by Nils Schmidt - 2013-01-08, 23:47
Text Editor Impression - by Nils Schmidt - 2013-01-13, 18:58
Re: Text Editor Impression - by Nils Schmidt - 2014-03-24, 17:54
Startup dialog - by Nils Schmidt - 2013-01-18, 15:25
Re: Startup dialog - by Philippe Hurbain - 2013-01-18, 18:37
Syntax Highlighting - by Nils Schmidt - 2013-01-27, 20:04
Test Environments - by Nils Schmidt - 2014-03-24, 17:32
Another Text Editor Teaser - by Nils Schmidt - 2014-03-24, 17:50
[LDPartEditor] Anaglyph Car - by Nils Schmidt - 2014-05-10, 22:58
[LDPartEditor] CSG - A more complex example with DAT source code - by Nils Schmidt - 2014-06-25, 15:07

Forum Jump:


Users browsing this thread: 1 Guest(s)