Class ModelCurve
A curve which is visible in 3D.
Examples
// A line
var line = new Line(Vector3.Origin, new Vector3(5, 5, 5));
// An arc
var arc = new Arc(Vector3.Origin, 2.0, 45.0, 135.0);
// A polygon
var pline = Polygon.L(2, 2, 0.5);
// A Bezier
var a = Vector3.Origin;
var b = new Vector3(5, 0, 1);
var c = new Vector3(5, 5, 2);
var d = new Vector3(0, 5, 3);
var e = new Vector3(0, 0, 4);
var f = new Vector3(5, 0, 5);
var ctrlPts = new List<Vector3> { a, b, c, d, e, f };
var bezier = new Bezier(ctrlPts);
var lineModelCurve = new ModelCurve(line, new Material("Red", Colors.Red) { EdgeDisplaySettings = new EdgeDisplaySettings { LineWidth = 5, DashMode = EdgeDisplayDashMode.WorldUnits, DashSize = 0.1 } });
var arcModelCurve = new ModelCurve(arc, new Material("Orange", Colors.Orange) { EdgeDisplaySettings = new EdgeDisplaySettings { LineWidth = 0.1, WidthMode = EdgeDisplayWidthMode.WorldUnits } }, new Transform(5, 0, 0));
var plineModelCurve = new ModelCurve(pline, new Material("Purple", Colors.Purple) { EdgeDisplaySettings = new EdgeDisplaySettings { LineWidth = 10, WidthMode = EdgeDisplayWidthMode.ScreenUnits, DashMode = EdgeDisplayDashMode.ScreenUnits, DashSize = 10, GapSize = 4 } }, new Transform(10, 0, 0));
var bezierModelCurve = new ModelCurve(bezier, new Material("Green", Colors.Green) { EdgeDisplaySettings = new EdgeDisplaySettings { LineWidth = 1, WidthMode = EdgeDisplayWidthMode.WorldUnits } }, new Transform(15, 0, 0));
Implements
System.ComponentModel.INotifyPropertyChanged
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 class ModelCurve : GeometricElement, INotifyPropertyChanged
Constructors
ModelCurve(BoundedCurve, Material, Transform, Representation, Boolean, Guid, String)
Create a model curve.
Declaration
public ModelCurve(BoundedCurve curve, Material material = null, Transform transform = null, Representation representation = null, bool isElementDefinition = false, Guid id = default(Guid), string name = null)
Parameters
Type | Name | Description |
---|---|---|
BoundedCurve | curve | The curve. |
Material | material | The material. Specular and glossiness components will be ignored. |
Transform | transform | The model curve's transform. |
Representation | representation | The curve's representation. |
System.Boolean | isElementDefinition | Is this an element definition? |
System.Guid | id | The id of the model curve. |
System.String | name | The name of the model curve. |
Properties
Curve
The curve.
Declaration
public BoundedCurve Curve { get; set; }
Property Value
Type | Description |
---|---|
BoundedCurve |
Methods
SetSelectable(Boolean)
Set whether this model curve should be selectable in the web UI.
Declaration
public void SetSelectable(bool selectable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | selectable |
TryToGraphicsBuffers(out List<GraphicsBuffers>, out String, out Nullable<MeshPrimitive.ModeEnum>)
Get graphics buffers and other metadata required to modify a GLB.
Declaration
public override bool TryToGraphicsBuffers(out List<GraphicsBuffers> graphicsBuffers, out string id, out MeshPrimitive.ModeEnum? mode)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<GraphicsBuffers> | graphicsBuffers | |
System.String | id | |
System.Nullable<glTFLoader.Schema.MeshPrimitive.ModeEnum> | mode |
Returns
Type | Description |
---|---|
System.Boolean | True if there is graphicsbuffers data applicable to add, false otherwise. Out variables should be ignored if the return value is false. |
Overrides
Implements
System.ComponentModel.INotifyPropertyChanged