The STL design can be used to receive imported STL objects. Both binary and ASCII files are accepted.
Note that by default, the import process creates a PolyfaceMesh which has face normals, which leads to a facetted look, even for surfaces which are intended to be smooth. Lighting and materials can affect this. Use the hardEdgeAngle to control where edges are drawn.
Parameter Rules
file: | A file reference. |
Example: | { name: 'Pièce - portique - 2.STL', id: '89b87e21-4008-4ac8-5571-08d8e8652680' }; |
url: | The URL to the file. |
Example: | R.getUrl(this.file); |
hardEdgeAngle: | Angle between facets above which will show an edge |
Example: | 10; |
scale: | The scale by which the STL geometry should be multiplied by. Set this for a uniform scaling. Set the individual xScale, yScale, and zScale for non-uniform scaling. |
Example: | 1; |
xScale: | The scale by which the x-direction should be multiplied by. |
Example: | this.scale; |
yScale: | The scale by which the y-direction should be multiplied by. |
Example: | this.scale; |
zScale: | The scale by which the z-direction should be multiplied by. |
Example: | this.scale; |
Mixins
STLRenderMixin
Render3Mixin
FrameMixin
BaseAssembly
AssemblyRenderMixin
AssemblyMixin
RULE NAME |
TYPE |
DEFAULTS |
CATEGORY |
FLAGS |
---|---|---|---|---|
file |
file |
<Empty> |
Inputs |
Cached Required |
url |
string |
R.getUrl(this.file); |
Inputs |
Cached |
hardEdgeAngle |
number |
10; |
Inputs |
Cached |
scale |
number |
1.0; |
Inputs |
Cached |
xScale |
number |
this.scale; |
Inputs |
Cached |
yScale |
number |
this.scale; |
Inputs |
Cached |
zScale |
number |
this.scale; |
Inputs |
Cached |
Project Example:
In your kBridge Examples Projects folder, open the project called ‘STL Project’.
Reference Location:
'World.Stl_project.Knob_Stl'
An .STL file was downloaded and placed into the Resources folder. A design was created and named 'Knob_STL' and placed under the root (STL_Project).
In the 'file' parameter rule in 'Knob_STL' the GetReference check box was selected and the .STL file was selected from the Resources folder.
The Knob model is then displayed in the Graphics Window.
Note: Some .STL files can be rather large and may slow down your program.