Request for new primitives


Request for new primitives
#1
Hello,

Among the primitives, there is the primitive n-fchrd.dat. This primitive is well suited for creating a transition to, for example, an enclosing circle. Unfortunately, the starting point of the circle segment is always at 0°. Sometimes it would be useful if this starting point were at 22.5°, for example. The circle segment would then go from 22.5° to 67.5°. In the high-resolution version, it would be 7.5° or a multiple thereof.

Rotation that is not equal to a step size of 90° results in rounding errors that can lead to visual errors.

Furthermore, a similar primitive would be useful, forming a circle segment from, for example, 22.5° to -22.5°. The center point of the circle segment would then be at 0°.

My question is whether it would be possible to introduce such primitives.

Best regards,

Manfred
Reply
Request for new primitives
#2
Hello,

I’d like to come back to my question above.
What is the procedure if I need primitives, as described above?
Can I simply create them, or are there specific rules to follow?
Question for Travis Cobbs: what about support for primitive substitution in LDView for these new primitives?

Best regards,

Manfred
Reply
RE: Request for new primitives
#3
(2026-03-24, 20:53)Manfred Schaefer Wrote: Question for Travis Cobbs: what about support for primitive substitution in LDView for these new primitives?

Regarding LDView, the best way to get it to support a new primitive is to create a GitHub issue. I will point out that I haven't spent a lot of time developing LDView for quite a few years now, but its development hasn't stopped.
Reply
RE: Request for new primitives
#4
(2026-03-24, 20:53)Manfred Schaefer Wrote: Hello,

I’d like to come back to my question above.
What is the procedure if I need primitives, as described above?
Can I simply create them, or are there specific rules to follow?
Question for Travis Cobbs: what about support for primitive substitution in LDView for these new primitives?

Best regards,

Manfred

Since your original question raised no objection, I say create them, and let the normal review process bring up any issues of compliance.
Reply
RE: Request for new primitives
#5
(2026-03-25, 3:43)N. W. Perry Wrote: Since your original question raised no objection, I say create them, and let the normal review process bring up any issues of compliance.

I think the prim definition spec states that all prim must start at x=1 (and that is equal to 0 degrees) and then continue ccw.
Reply
RE: Request for new primitives
#6
(2026-01-02, 18:53)Manfred Schaefer Wrote: Among the primitives, there is the primitive n-fchrd.dat. This primitive is well suited for creating a transition to, for example, an enclosing circle. Unfortunately, the starting point of the circle segment is always at 0°. Sometimes it would be useful if this starting point were at 22.5°, for example. The circle segment would then go from 22.5° to 67.5°. In the high-resolution version, it would be 7.5° or a multiple thereof.

Rotation that is not equal to a step size of 90° results in rounding errors that can lead to visual errors.

Furthermore, a similar primitive would be useful, forming a circle segment from, for example, 22.5° to -22.5°. The center point of the circle segment would then be at 0°.

My question is whether it would be possible to introduce such primitives.
Any circle segment from -x to x can be replaced with two segments, each starting from 0. There is no need for pre-mirrored and superimposed primitives.

It is a well-known fact that rotation causes vertex mismatches. In most cases, one must choose a smaller primitive and/or use up to 6 decimals in the rotation matrix. There are also a number of tricks one can use to convert some of the most difficult angles to more reasonable angles. Vertex mismatches under 0.001 LDU are negligible.
Reply
RE: Request for new primitives
#7
(2026-03-25, 11:04)Magnus Forsberg Wrote: I think the prim definition spec states that all prim must start at x=1 (and that is equal to 0 degrees) and then continue ccw.

I’ll see if I can find anything on this. The questions that remain are: Does this restriction make sense, and do all parts of a primitive have to be visible?

Regards

Manfred
Reply
RE: Request for new primitives
#8
(8 hours ago)Peter Blomberg Wrote: Any circle segment from -x to x can be replaced with two segments, each starting from 0. There is no need for pre-mirrored and superimposed primitives.
It is a well-known fact that rotation causes vertex mismatches. In most cases, one must choose a smaller primitive and/or use up to 6 decimals in the rotation matrix. There are also a number of tricks one can use to convert some of the most difficult angles to more reasonable angles. Vertex mismatches under 0.001 LDU are negligible.

Sorry, but I don’t quite understand your answer.
If I need a circular segment ranging from 22.5° to 45°, the only option I can see is to use the primitive that ranges from 0° to 22.5° and rotate it by 22.5°. However, this rotation causes rounding errors, which should be avoided.
What’s more, the number of decimal places should be kept to a minimum, otherwise this can lead to further problems. As is currently the case with flat designs, where the limit is three, if I remember correctly.

Regards 

Manfred
Reply
RE: Request for new primitives
#9
(7 hours ago)Manfred Schaefer Wrote: Sorry, but I don’t quite understand your answer.
If I need a circular segment ranging from 22.5° to 45°, the only option I can see is to use the primitive that ranges from 0° to 22.5° and rotate it by 22.5°. However, this rotation causes rounding errors, which should be avoided.
What’s more, the number of decimal places should be kept to a minimum, otherwise this can lead to further problems. As is currently the case with flat designs, where the limit is three, if I remember correctly.
This is an example of converting the challenging angles to easier angles.
You'd rotate the prim by 45°.

You are correct in that 3 decimals are usually enough for vertex coordinates. In rotation matrices, however, more decimals (up to 6, sometimes even 7 if motivated properly) can be used to maintain reasonable accuracy of the resulting vertices.
Reply
RE: Request for new primitives
#10
(7 hours ago)Manfred Schaefer Wrote: ... do all parts of a primitive have to be visible?
The simple answer is: no, all parts of a primitive need not be visible. There are acceptable use cases where part of a primitive is obscured by other geometry. Avoid T-junctions where an edge of a non-visible surface goes along the surface of a visible surface as this creates optical flickering.

The more accurate answer would include considerations for minimizing/balancing the need for intersections with part complexity (number of lines required to create a particular geometry without intersections). If the part is transparent in any color, then superfluous interior surfaces should specifically be avoided as much as possible.
Reply
RE: Request for new primitives
#11
(7 hours ago)Peter Blomberg Wrote: more decimals (up to 6, sometimes even 7 if motivated properly) can be used

This is incorrect. Anything >5 decimals is contrary to the library spec and this is enforced on submit. 

Think of it this way: 1 ldu = .4mm. At 6 decimal places, 0.000001 ldu  = 0.0000004 mm or .4 nm which is overkill for precision. Any gaps at this level are insignificant.
Reply
RE: Request for new primitives
#12
(7 hours ago)Manfred Schaefer Wrote: I’ll see if I can find anything on this. 

"Where this fraction is less than an entire circle, the primitive starts at {+x,0} and progresses in a conterclockwise direction when viewed from above {-y}."

https://wiki.ldraw.org/wiki/Primitives_R...primitives
Reply
RE: Request for new primitives
#13
(7 hours ago)Orion Pobursky Wrote: This is incorrect. Anything >5 decimals is contrary to the library spec and this is enforced on submit. 

Think of it this way: 1 ldu = .4mm. At 6 decimal places, 0.000001 ldu  = 0.0000004 mm or .4 nm which is overkill for precision. Any gaps at this level are insignificant.
So the specifications have changed since a year ago?

Also, it wasn't about the vertex coordinates. It was about the rotation matrix. Sometimes, when one rotates and scales a primitive, the added decimals in the rotation matrix may be needed to achieve 3 decimals on the vertices. I've also encountered more than 5 decimals when the overall part has 3-fold, 5-fold, and 7-fold rotational symmetry. Have all such cases been updated to 5 decimals?
Reply
RE: Request for new primitives
#14
(7 hours ago)Peter Blomberg Wrote: This is an example of converting the challenging angles to easier angles.
You'd rotate the prim by 45°.

You are correct in that 3 decimals are usually enough for vertex coordinates. In rotation matrices, however, more decimals (up to 6, sometimes even 7 if motivated properly) can be used to maintain reasonable accuracy of the resulting vertices.

I need a circular segment from 22.5° to 45°.
If I understand your explanation correctly, I would end up with a segment from 45° to 67.5°.
This means I would have to reflect a circular segment from 0° to 22.5° across the x-axis and then rotate it by 45° about the y-axis. However, a rotation of 45° implies a factor of 0.707... which results in too many decimal places.

Regards

Manfred
Reply
RE: Request for new primitives
#15
(6 hours ago)Magnus Forsberg Wrote: "Where this fraction is less than an entire circle, the primitive starts at {+x,0} and progresses in a conterclockwise direction when viewed from above {-y}."

https://wiki.ldraw.org/wiki/Primitives_R...primitives

Thanks for your answer

From the link in your reply:
[...] Where the naming convention includes a prefix of the form n-f, this indicates the fraction (n/f) of the circle drawn by the primitive. Where this fraction is less than a full circle, the primitive starts at {+x,0} and proceeds in an anti-clockwise direction when viewed from above {-y}. [...]

This merely states that this prefix exists, but not that other prefixes are prohibited.

There is an error in the following section, or perhaps I am misunderstanding it:

[...] For example, use 3-16XXXX.dat rather than combining 1-8XXXX.dat with 1-16XXXX.dat rotated by 22.5 degrees.

3/16 corresponds to 67.5′
1/8 corresponds to 45°
1/16 corresponds to 22.5°
From this, I conclude that if I want to combine 3/16 with 1/8 and 1/16, I would have to rotate the 1/16 by 45°. Or if I were to combine 1/16 with 1/8, I would have to rotate the 1/8 by 22.5°. 

Regards

Manfred
Reply
RE: Request for new primitives
#16
(6 hours ago)Peter Blomberg Wrote: So the specifications have changed since a year ago?

Also, it wasn't about the vertex coordinates. It was about the rotation matrix. Sometimes, when one rotates and scales a primitive, the added decimals in the rotation matrix may be needed to achieve 3 decimals on the vertices. I've also encountered more than 5 decimals when the overall part has 3-fold, 5-fold, and 7-fold rotational symmetry. Have all such cases been updated to 5 decimals?

It's always been >5 is not allowed. The only change is that the PT is now automatically enforcing this standard.

I will say that it has been unevenly enforced.
Reply
RE: Request for new primitives
#17
the nice thing about these primitives is that they can be oriented and rotated both ways...
a 22.5 to 45° prim can be done by rotating a 1-16 prim by 22.5° or mirror it to -22.5° and then rotating it by 45°.
a 22.5->45 prim is almost the same as a 45->22.5, but they have different rotation matrices.
as the starting point (the 0° position at 1 0 0) gets scaled by the rotation matrix, it has the clearer vertices than the far end, which has many decimals (from multiplying a fraction with a fraction)
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 1 Guest(s)