Class RibbonMesh
Generate a mesh with a certain cross section along given points and rotations.
Contrary to the LineExtruder and ParallelTransportTubeMesh, the rotations of the cross sections have to be given explicitly and are not calculated automatically.
Inheritance
System.Object
RibbonMesh
Assembly: VRSketchingGeometry.dll
Syntax
Constructors
RibbonMesh(List<Vector3>, Vector3)
Declaration
public RibbonMesh(List<Vector3> crossSection, Vector3 scale)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
crossSection |
|
| UnityEngine.Vector3 |
scale |
|
RibbonMesh(Vector3)
Flat ribbon shaped mesh.
Cross section is a straight line along local z axis.
Declaration
public RibbonMesh(Vector3 scale)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
scale |
|
Properties
Scale
Declaration
public Vector3 Scale { get; }
Property Value
| Type |
Description |
| UnityEngine.Vector3 |
|
Methods
AddPoint(Vector3, Quaternion)
Add single point to the end of the mesh.
Declaration
public Mesh AddPoint(Vector3 point, Quaternion rotation)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
point |
|
| UnityEngine.Quaternion |
rotation |
|
Returns
| Type |
Description |
| UnityEngine.Mesh |
|
AddPoints(List<Vector3>, List<Quaternion>)
Add to the end of the existing mesh.
Declaration
public Mesh AddPoints(List<Vector3> points, List<Quaternion> rotations)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
points |
|
| System.Collections.Generic.List<UnityEngine.Quaternion> |
rotations |
|
Returns
| Type |
Description |
| UnityEngine.Mesh |
|
DeletePoint()
Delete the last point of the mesh.
Declaration
public Mesh DeletePoint()
Returns
| Type |
Description |
| UnityEngine.Mesh |
|
GetCrossSection()
Declaration
public List<Vector3> GetCrossSection()
Returns
| Type |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
|
GetMesh(List<Vector3>, List<Quaternion>)
Get mesh for points and rotations.
Existing mesh is overwritten.
Declaration
public Mesh GetMesh(List<Vector3> points, List<Quaternion> rotations)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
points |
|
| System.Collections.Generic.List<UnityEngine.Quaternion> |
rotations |
|
Returns
| Type |
Description |
| UnityEngine.Mesh |
|
GetMesh(List<Vector3>, List<Vector3>, List<Quaternion>, Vector3)
Get the mesh with the cross sections placed at the points oriented by the rotations.
Cross sections are scaled by scale.
Declaration
public static Mesh GetMesh(List<Vector3> crossSection, List<Vector3> points, List<Quaternion> rotations, Vector3 scale)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
crossSection |
|
| System.Collections.Generic.List<UnityEngine.Vector3> |
points |
|
| System.Collections.Generic.List<UnityEngine.Quaternion> |
rotations |
|
| UnityEngine.Vector3 |
scale |
|
Returns
| Type |
Description |
| UnityEngine.Mesh |
|
GetMeshFromVertices(List<Vector3>, Int32)
Generate a mesh object from the given vertices.
Declaration
public static Mesh GetMeshFromVertices(List<Vector3> vertices, int crossSectionCount)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
vertices |
|
| System.Int32 |
crossSectionCount |
Number of vertices per cross section.
|
Returns
| Type |
Description |
| UnityEngine.Mesh |
|
GetVertices(List<Vector3>, List<Vector3>, List<Quaternion>, Vector3)
Place the cross sections at the points oriented by the rotations.
Declaration
public static List<Vector3> GetVertices(List<Vector3> crossSection, List<Vector3> points, List<Quaternion> rotations, Vector3 scale)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
crossSection |
|
| System.Collections.Generic.List<UnityEngine.Vector3> |
points |
|
| System.Collections.Generic.List<UnityEngine.Quaternion> |
rotations |
|
| UnityEngine.Vector3 |
scale |
Cross sections are scaled by this vector.
|
Returns
| Type |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
|
Transform a single point.
Declaration
public static Vector3 TransformPoint(Vector3 point, Vector3 position, Quaternion rotation, Vector3 scale)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
point |
|
| UnityEngine.Vector3 |
position |
|
| UnityEngine.Quaternion |
rotation |
|
| UnityEngine.Vector3 |
scale |
|
Returns
| Type |
Description |
| UnityEngine.Vector3 |
|
Transform the points of a cross section according to position, rotation and scale.
Declaration
public static List<Vector3> TransformPoints(List<Vector3> crossSection, Vector3 position, Quaternion rotation, Vector3 scale)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
crossSection |
|
| UnityEngine.Vector3 |
position |
|
| UnityEngine.Quaternion |
rotation |
|
| UnityEngine.Vector3 |
scale |
|
Returns
| Type |
Description |
| System.Collections.Generic.List<UnityEngine.Vector3> |
|