LDraw.org Discussion Forums
How do digital lego builders procedurally generate the positions of anti-studs? - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: General (https://forums.ldraw.org/forum-12.html)
+--- Forum: Help (https://forums.ldraw.org/forum-13.html)
+--- Thread: How do digital lego builders procedurally generate the positions of anti-studs? (/thread-23278.html)



How do digital lego builders procedurally generate the positions of anti-studs? - Lasse Boijens - 2019-03-14

So I was wondering, does anybody know how lego builders using LDraw assign the locations of all holes/anti-studs?

I'm building my own VR lego builder and getting the studs in is easy because there is a subfile for 'stud' which I can just detect and save the position of. However, since holes are not one subpart but rather the space in-between other subparts, I have no idea how to do this without going through brick-by-brick.

I presume that there must be some method of doing this since I highly doubt that the creators of programs like leocad/stud.io/ldd have taken the time to manually enter the locations for all the hundreds of thousands of anti-studs. I know that leocad is open source but unfortunately, due to my inexperience with the way that program is written, I am unable to find how it is handled there.

Does anyone happen to know how/if it can be done?


RE: How do digital lego builders procedurally generate the positions of anti-studs? - Travis Cobbs - 2019-03-15

(2019-03-14, 11:40)Lasse Boijens Wrote: So I was wondering, does anybody know how lego builders using LDraw assign the locations of all holes/anti-studs?

I'm building my own VR lego builder and getting the studs in is easy because there is a subfile for 'stud' which I can just detect and save the position of. However, since holes are not one subpart but rather the space in-between other subparts, I have no idea how to do this without going through brick-by-brick.

I presume that there must be some method of doing this since I highly doubt that the creators of programs like leocad/stud.io/ldd have taken the time to manually enter the locations for all the hundreds of thousands of anti-studs. I know that leocad is open source but unfortunately, due to my inexperience with the way that program is written, I am unable to find how it is handled there.

Does anyone happen to know how/if it can be done?

LDCad has a custom connections database for determining how parts should connect to each other. Your best bet is probably to support that (or at least a subset of that).


RE: How do digital lego builders procedurally generate the positions of anti-studs? - Lasse Boijens - 2019-03-15

(2019-03-15, 1:33)Travis Cobbs Wrote: LDCad has a custom connections database for determining how parts should connect to each other. Your best bet is probably to support that (or at least a subset of that).

I have LDCad installed, and I have the website, but I'm unable to find it...? I'm sorry it's probably due to my own incompetence but could you send me a link/instructions on where to find it? Thanks for the help though.


RE: How do digital lego builders procedurally generate the positions of anti-studs? - Philippe Hurbain - 2019-03-15

(2019-03-15, 10:22)Lasse Boijens Wrote: I have LDCad installed, and I have the website, but I'm unable to find it...? I'm sorry it's probably due to my own incompetence but could you send me a link/instructions on where to find it? Thanks for the help though.

First have a look at documentation http://www.melkert.net/LDCad/tech/meta (Part snapping metas section).
As for the snapping library, go to %appdata%\LDCad\shadow\offLib, and unzip offLibShadow.csl


RE: How do digital lego builders procedurally generate the positions of anti-studs? - Lasse Boijens - 2019-03-15

(2019-03-15, 11:11)Philippe Hurbain Wrote: First have a look at documentation http://www.melkert.net/LDCad/tech/meta (Part snapping metas section).
As for the snapping library, go to %appdata%\LDCad\shadow\offLib, and unzip offLibShadow.csl

Yeah that should probably work... Thanks for the help man I appreciate it!