Studs with Logos: Difference between revisions

From LDraw.org Wiki
Jump to navigation Jump to search
No edit summary
 
(29 intermediate revisions by the same user not shown)
Line 1: Line 1:
WORK IN PROGRESS
This page explains the possible options you have for modifying
the appearance of '''studs with logos''' in rendering software.


[[Stud]]s we refer to on this page are the top connectors on for example the standard 2 x 4 Brick.
Bottom connectors are also called studs but are not topic of this page.
The LDRAW Library contains a default implementation for a top stud,
which can be found in file <code>stud.dat</code> and is of course a [[primitive]].
Depending on your rendering configuration, it could look like this in [[LDView]]:


Studs are the top connectors on for example the standard 2 x 4 Brick.
<!--
The LDRAW Library contains a default implementation for that,
the LDView images on this page have been rendered with the following LDView camera command line options:
which can be found in file <code>stud.dat</code>, which is of course a [[primitive]].
  -DefaultMatrix=-0.601901,-0.000642125,0.798565,0.365988,0.888568,0.276568,-0.709758,0.458734,-0.534596 -DefaultZoom=0.774893
It can be seen here:
-->


[[Image:stud-default.png]]
[[Image:stud-default.png]]
Line 16: Line 22:
For example, to some people (this includes [[User:Steffen|me]], the author of these lines),
For example, to some people (this includes [[User:Steffen|me]], the author of these lines),
a Lego brick is not a real Lego brick if the top studs have no logo.
a Lego brick is not a real Lego brick if the top studs have no logo.
The logo can also be used to visually check with a simple glance if the studs on a part are properly oriented.


[[Image:stud-logo.png]]
[[Image:stud-logo.png]]
Line 31: Line 38:
Software which renders a part can easily identify studs at runtime, simply by their filename
Software which renders a part can easily identify studs at runtime, simply by their filename
as a primitive: <code>stud.dat</code>.
as a primitive: <code>stud.dat</code>.
The software might then substitute that by anything it wants.
The software might then substitute that by anything it wants,
Here some examples:
see the following examples:


* LDView can substitute studs by native OpenGL cylinders instead of polygons, plus an optional OpenGL logo texture on top:
LDView can substitute studs by native [[OpenGL]] cylinders instead of polygons, plus an optional OpenGL logo texture on top.
You can notice that the stud no longer appears faceted made of polygons, but as a smooth cylinder,
however the logo is straight flat and has no 3D structure:


[[Image:stud-OpenGL.png]]
[[Image:stud-OpenGL.png]]


* LDView also can substitute studs by a simplified version with less polygons:
LDView also can substitute studs by a simplified version with less polygons:


[[Image:stud-low-quality.png]]
[[Image:stud-low-quality.png]]
Line 44: Line 53:
Both things can be configured in LDView's preferences.
Both things can be configured in LDView's preferences.


* MLCad can substitute studs by a single vertical line:
During export to [[POVRay]], LDView can also substitute studs by a native POVRay objects implementation,
which by its nature of course is real 3D. As such, it comes with the expense of rendering time increase.
There are switches within the generated POVRay source code to turn the logo on and off
and to turn the studs on and off.


image
[[Image:POVRay Studs exported from LDView.png]]
 
[[MLCad]] can do stud substitution as well. It can replace them by a coarse version with less polygons,
or, if memory/CPU usage really is critical, can minimize their graphical representation
to display just single lines:
 
[[Image:MLCad_Normal.png]] [[Image:MLCad_Coarse.png]] [[Image:MLCad_Lines.png]]


=== Replacement Directly in the LDRAW Library ===
=== Replacement Directly in the LDRAW Library ===
Line 59: Line 77:
but additionally delivers implementation variants, which provide the logo implementation
but additionally delivers implementation variants, which provide the logo implementation
in differing detail levels:
in differing detail levels:
* <code>stud-logo.dat</code>
* <code>stud-logo2.dat</code>
* <code>stud-logo3.dat</code>
* <code>stud-logo4.dat</code>
* <code>stud-logo5.dat</code>


<code>stud-logo.dat</code>:
[[Image:stud-logo.png]]
[[Image:stud-logo.png]]
*stud-logo.dat*


<code>stud-logo2.dat</code>:
[[Image:stud-logo2.png]]
[[Image:stud-logo2.png]]
*stud-logo2.dat*


<code>stud-logo3.dat</code>:
[[Image:stud-logo3.png]]
[[Image:stud-logo3.png]]
*stud-logo3.dat*


<code>stud-logo4.dat</code>:
[[Image:stud-logo4.png]]
[[Image:stud-logo4.png]]
*stud-logo4.dat*


<code>stud-logo5.dat</code>:
[[Image:stud-logo5.png]]
[[Image:stud-logo5.png]]
*stud-logo5.dat*


Additionally, another variant
Additionally, another variant with high contrast is provided,
* <code>stud-high-contrast.dat</code>
which displays a stud as it can be frequently seen in official LEGO instructions
 
(for example [http://peeron.com/scans/577-1/13/ here]):
is provided, which displays a stud as it can be frequently seen in official LEGO instructions:


<code>stud-high-contrast.dat</code>:
[[Image:stud-high-contrast.png]]
[[Image:stud-high-contrast.png]]
*stud-high-contrast.dat*


== Usage of the Variants ==
== Usage of the Variants ==
Line 92: Line 104:
You could use a software which can switch between using <code>stud.dat</code>
You could use a software which can switch between using <code>stud.dat</code>
or one of the variants above. At the time of this writing, no such software exists yet,
or one of the variants above. At the time of this writing, no such software exists yet,
because the stud variants are not official yet. This therefore is a scenario for the future.
because the stud variants are not released as official files yet (2019-06).  
Similar to LDView and MLCad as shown above, software in future might toggle between the different
stud implementations offered in the LDRAW library.


Until that is possible, the current solution to use the stud variants is that you modify your
Until that becomes possible, a current method for changing the stud
library locally in the filesystem. The change is quite simple:
appearance is modifying the contents of file <code>stud.dat</code> with a simple
you just need to do this: choose the variant you want to use, for example <code>stud-logo.dat</code>.
text editor so that it uses one of the implementations above.
Open the official file <code>stud.dat</code> in some text editor,  
 
and comment-out (deactivate) its default implementation, and comment-in (activate)
Here is an example,
the implementation you want. Example:
the file contents has been simplified (history headers left out etc.) to more clearly show the change:


Before:
Before:
<pre>
0 Stud
0 Name: stud.dat
0 Author: James Jessiman
0 !LDRAW_ORG Official_Primitive
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt


xxx
0 BFC CERTIFY CCW
 
1 16 0 -4 0 6 0 0 0 4 0 0 0 6 4-4cylc.dat
</pre>


After:
After:
<pre>
0 Stud
0 Name: stud.dat
0 Author: James Jessiman
0 !LDRAW_ORG Official_Primitive
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt
0 BFC CERTIFY CCW
0 // 1 16 0 -4 0 6 0 0 0 4 0 0 0 6 4-4cylc.dat
1 16 0 0 0 1 0 0 0 1 0 0 0 1 stud-logo.dat
</pre>
== stud2.dat ==
All of the above does not only apply to the standard top stud <code>stud.dat</code>,
but analogously to its sibling, the hollow stud <code>stud2.dat</code>.
For it, substitutional implementations are provided by the LDRAW Library in the same way:
* <code>stud2-logo.dat</code>
* <code>stud2-logo2.dat</code>
* <code>stud2-logo3.dat</code>
* <code>stud2-logo4.dat</code>
* <code>stud2-logo5.dat</code>
* <code>stud2-high-contrast.dat</code>


xxx
[[Category:Tutorials]]

Latest revision as of 10:09, 10 June 2019

This page explains the possible options you have for modifying the appearance of studs with logos in rendering software.

Studs we refer to on this page are the top connectors on for example the standard 2 x 4 Brick. Bottom connectors are also called studs but are not topic of this page. The LDRAW Library contains a default implementation for a top stud, which can be found in file stud.dat and is of course a primitive. Depending on your rendering configuration, it could look like this in LDView:


To speedup renderings in editors for parts and scenes, that default implementation (currently) does not include a logo, opposed to what can be seen on real parts.

However, when doing high-quality renders, when creating building instructions, or even during normal part and scene editing, a logo could be desired. For example, to some people (this includes me, the author of these lines), a Lego brick is not a real Lego brick if the top studs have no logo. The logo can also be used to visually check with a simple glance if the studs on a part are properly oriented.

The opposite is the case if rendering or processing time shall be saved: in such a case it can be desired to only use a simplified stud (less polygons), or even a stronger simplified stud (just "mimicked" by a single, simple line), or even leave out all studs completely.

For doing these replacements of studs, 2 options exist:

Options for Stud Replacement

Replacement by Editing/Rendering Software at Runtime

Software which renders a part can easily identify studs at runtime, simply by their filename as a primitive: stud.dat. The software might then substitute that by anything it wants, see the following examples:

LDView can substitute studs by native OpenGL cylinders instead of polygons, plus an optional OpenGL logo texture on top. You can notice that the stud no longer appears faceted made of polygons, but as a smooth cylinder, however the logo is straight flat and has no 3D structure:

LDView also can substitute studs by a simplified version with less polygons:

Both things can be configured in LDView's preferences.

During export to POVRay, LDView can also substitute studs by a native POVRay objects implementation, which by its nature of course is real 3D. As such, it comes with the expense of rendering time increase. There are switches within the generated POVRay source code to turn the logo on and off and to turn the studs on and off.

MLCad can do stud substitution as well. It can replace them by a coarse version with less polygons, or, if memory/CPU usage really is critical, can minimize their graphical representation to display just single lines:

Replacement Directly in the LDRAW Library

Replacing the contents of file stud.dat with something else of course also is possible locally in the filesystem.

Support by the LDRAW Library

The LDRAW Library supports both solutions described above. It not only delivers the default stud implementation inside file stud.dat, but additionally delivers implementation variants, which provide the logo implementation in differing detail levels:

stud-logo.dat:

stud-logo2.dat:

stud-logo3.dat:

stud-logo4.dat:

stud-logo5.dat:

Additionally, another variant with high contrast is provided, which displays a stud as it can be frequently seen in official LEGO instructions (for example here):

stud-high-contrast.dat:

Usage of the Variants

You could use a software which can switch between using stud.dat or one of the variants above. At the time of this writing, no such software exists yet, because the stud variants are not released as official files yet (2019-06).

Until that becomes possible, a current method for changing the stud appearance is modifying the contents of file stud.dat with a simple text editor so that it uses one of the implementations above.

Here is an example, the file contents has been simplified (history headers left out etc.) to more clearly show the change:

Before:

0 Stud
0 Name: stud.dat
0 Author: James Jessiman
0 !LDRAW_ORG Official_Primitive
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt

0 BFC CERTIFY CCW

1 16 0 -4 0 6 0 0 0 4 0 0 0 6 4-4cylc.dat

After:

0 Stud
0 Name: stud.dat
0 Author: James Jessiman
0 !LDRAW_ORG Official_Primitive
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt

0 BFC CERTIFY CCW

0 // 1 16 0 -4 0 6 0 0 0 4 0 0 0 6 4-4cylc.dat
1 16 0 0 0 1 0 0 0 1 0 0 0 1 stud-logo.dat

stud2.dat

All of the above does not only apply to the standard top stud stud.dat, but analogously to its sibling, the hollow stud stud2.dat. For it, substitutional implementations are provided by the LDRAW Library in the same way:

  • stud2-logo.dat
  • stud2-logo2.dat
  • stud2-logo3.dat
  • stud2-logo4.dat
  • stud2-logo5.dat
  • stud2-high-contrast.dat