Class ImportMeshElement
An element definition whose representation is provided by an imported mesh like an STL.
Examples
var path = "../../../models/STL/Hilti_2008782_Speed lock clevis hanger MH-SLC 2_ EG_2.stl";
var shiny = new Material("shiny", Colors.Red, 1.0, 0.9);
var bracket = new ImportMeshElement(path, Units.LengthUnit.Millimeter, shiny);
model.AddElement(bracket);
var brackets = new List<ElementInstance>();
for (var u = 0; u < 360.0; u += 20)
{
var t = new Transform(new Vector3(1, 0, 0));
t.Rotate(Vector3.ZAxis, u);
var instance = bracket.CreateInstance(t, $"Component_{u}");
model.AddElement(instance);
}
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Elements
Assembly: Hypar.Elements.dll
Syntax
public sealed class ImportMeshElement : MeshElement, INotifyPropertyChanged, ITessellate
Constructors
ImportMeshElement(String, Units.LengthUnit, Material, Guid, String)
Construct an import mesh element.
Declaration
public ImportMeshElement(string path, Units.LengthUnit lengthUnit, Material material = null, Guid id = default(Guid), string name = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to the element's mesh on disk. |
Units.LengthUnit | lengthUnit | The length unit used in the provided mesh. |
Material | material | The element's material. |
System.Guid | id | The element's id. |
System.String | name | The element's name. |
Properties
Path
The path to the element's mesh on disk.
Declaration
public string Path { get; }
Property Value
Type | Description |
---|---|
System.String |
Implements
System.ComponentModel.INotifyPropertyChanged