Variables in LDraw files


LDPartEditor 1.8.60 has variables/constants now (unofficial meta command)
#18
(2022-07-06, 12:31)Cam's Bricks Wrote: I am pretty sure the answer is "no, no, not ever, no thanks, that is a terrible idea" BUT I wanted to ask if there is support for variables in the LDraw file format?
I am someone who enjoys the "make it once and for all use cases", so the pragmatic nature of making a lot of similar parts that have one or two changes for each iteration feels quite bothersome.

(2022-07-08, 16:07)Max Murtazin Wrote: I would like to see this being adopted as an optional feature, maybe even one day this growing into smth like an internal ldraw scripting language, since stuff like this would probably be really neat for use in custom parts and stuff. 

For example, what I could see being a thig are also matrix variables, that could probably be applied to the line after them with a meta command. All such QOL stuff

Also, with those ideas, I could also imagine something like a "compiler" of LDraw files using those features into a proper LDraw file

A part editor supports now variables on its own.

Example:

Code:
0
0 Name: new.dat
0 Author: Nils Schmidt [BlackBrick89]
0 !LDRAW_ORG Unofficial_Part
0 !LICENSE Licensed under CC BY 4.0 : see CAreadme.txt

0 BFC CERTIFY CCW

0 !LPE CONST height = 1*24
0 !LPE CONST inner = height-4
1 16 0 height 0 6 0 0 0 -inner 0 0 0 6 box5.dat

4 16 10 height 10 6 height 6 -6 height 6 -10 height 10
4 16 -10 height 10 -6 height 6 -6 height -6 -10 height -10
4 16 -10 height -10 -6 height -6 6 height -6 10 height -10
4 16 10 height -10 6 height -6 6 height 6 10 height 10

1 16 0 height 0 10 0 0 0 -height 0 0 0 10 box5.dat

1 16 0 0 0 1 0 0 0 1 0 0 0 1 stud.dat

More here:
https://forums.ldraw.org/showthread.php?...e=threaded
Reply
« Next Oldest | Next Newest »



Messages In This Thread
Variables in LDraw files - by Cam's Bricks - 2022-07-06, 12:31
Constants in LDraw files - by Nils Schmidt - 2022-07-07, 20:42
LDPartEditor 1.8.60 has variables/constants now (unofficial meta command) - by Nils Schmidt - 2022-07-10, 12:24

Forum Jump:


Users browsing this thread: 2 Guest(s)