LDraw.org Discussion Forums
add a new meta 0 !ORIGIN - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: General (https://forums.ldraw.org/forum-12.html)
+--- Forum: Official File Specifications/Standards (https://forums.ldraw.org/forum-32.html)
+--- Thread: add a new meta 0 !ORIGIN (/thread-15022.html)



add a new meta 0 !ORIGIN - Steffen - 2014-12-27

Following the discussion at
http://www.ldraw.org/cgi-bin/ptdetail.cgi?f=parts/6117.dat
on the PT, I'd like to suggest a new META for specifying a "good" origin of a file.

0 !ORIGIN x y z m1 m2 m3 m4 m5 m6 m7 m8 m9

It is just the keywords "0 !ORIGIN", followed by the usual translation and matrix data.
When not present, a default of

0 !ORIGIN 0 0 0 1 0 0 0 1 0 0 0 1

is assumed.

Adding this will allow us to adjust the "suggested" origin of parts even after they have become official,
WITHOUT breaking models that users have built with it.

Software aware of this new syntax can put its rotation center etc. to that origin when the user touches the part.


Re: add a new meta 0 !ORIGIN - Orion Pobursky - 2014-12-27

I like this idea a lot. Surprised we didn't come up with it sooner. Software can even let the user choose which origin to use.

Another useful aspect of this is setting the origin "correctly" for hinged parts but specifying in the meta the origin of the hinge or other natural rotation point.


Re: add a new meta 0 !ORIGIN - Roland Melkert - 2014-12-27

Orion Pobursky Wrote:Another useful aspect of this is setting the origin "correctly" for hinged parts but specifying in the meta the origin of the hinge or other natural rotation point.
I believe this was the reason the previous time someone suggested a center/origin meta it resulted in nothing. As there was a discussion about it making more then a simple center meta.


Re: add a new meta 0 !ORIGIN - Ben Supnik - 2014-12-28

Hi Steffen,

I'm not sure I understand the meaning of "origin" here.

If I understand the problem, some parts have their origins at places that make their relative location to other parts arbitrary, and some parts have their origin such that rotations about the origin do not provide the natural rotation for the part.

- Is the purpose of this META to allow editors to place the part at an initial location in the model model that is "logical" relative to the rest of the user's parts?

If so, what is the rotation matrix for? Specifying an initial rotation?

If so, is it enough to provide a -single- origin statement?

BrickSmith 3.x has a "relative parts" file that gives a series of matrices for inserting new parts based on a -specific- parent. For example, 4624.dat (Wheel Rim 6.4 x 8) can be placed relative to 13 different parent parts, but the transform varies based on the location of the wheel pin for each one.

- Is the purpose of the META to allow editors to rotate parts logically regardless of the original origin (e.g. 3938.dat hinge 1x2 top)?

If so, isn't there an existing unofficial META !ROTATE that specifies a rotation axis from MLCad? (I think I have this totally munged in my brain, I just have a vague memory that there's already an unofficial META I could pick up in Bricksmith some day).

I _do_ think being able to "fix" the origin after the fact is potentially valuable, and I don't want this post to turn into too much of "the great is the enemy of the good". But I'd like to understand under what use case we'd use this new META in Bricksmith...

Thank!
Ben


Re: add a new meta 0 !ORIGIN - Tim Gould - 2014-12-28

I love it. I'd like to see multiple origins allowed so that an editor (if the author felt like it) could add a "select your origin" option with a default to the first appearance or 0 if it's missing. That would be really useful for hinge parts and the likes.

Tim


Re: add a new meta 0 !ORIGIN - Steffen - 2015-01-02

+1


Re: add a new meta 0 !ORIGIN - Steffen - 2015-01-02

Ben Wrote:I'm not sure I understand the meaning of "origin" here.


I meant it this way:
The given translation and matrix at the statement have to be applied to the current file.
The result of that operation is the part at that origin.