Class Shape
An immutable primitive, indexed mesh instance, or transform group.
Namespace: Simple3D.Core
Assembly: Simple3D.Core.dll
Syntax
public sealed class Shape
Properties
|
Edit this page
View Source
Children
Immutable child nodes, transformed in this node's coordinate system.
Declaration
public IReadOnlyList<Shape> Children { get; }
Property Value
|
Edit this page
View Source
Color
Opaque packed 0xAARRGGBB surface color.
Declaration
public uint Color { get; }
Property Value
|
Edit this page
View Source
Geometry
Custom indexed mesh, or null for cached primitives and groups.
Declaration
public Mesh? Geometry { get; }
Property Value
|
Edit this page
View Source
Material
Declaration
public Material Material { get; }
Property Value
|
Edit this page
View Source
Name
Optional application identifier.
Declaration
public string? Name { get; }
Property Value
|
Edit this page
View Source
Position
Local position relative to the parent.
Declaration
public Vector3 Position { get; }
Property Value
|
Edit this page
View Source
Rotation
Local Euler rotation in radians.
Declaration
public Vector3 Rotation { get; }
Property Value
|
Edit this page
View Source
Size
Positive local scale factors.
Declaration
public Vector3 Size { get; }
Property Value
|
Edit this page
View Source
TriangleCount
Triangle count of this node, excluding descendants.
Declaration
public int TriangleCount { get; }
Property Value
Methods
|
Edit this page
View Source
Arrow(Vector3, Vector3, float, uint)
Creates a cylindrical shaft and conical arrowhead between distinct finite endpoints.
Declaration
public static Shape Arrow(Vector3 start, Vector3 end, float thickness = 0.03, uint color = 4286356991)
Parameters
Returns
|
Edit this page
View Source
At(float, float, float)
Returns a copy with an absolute position, preserving rotation and size.
Declaration
public Shape At(float x, float y, float z)
Parameters
Returns
|
Edit this page
View Source
Box(uint)
Creates a cached unit box centered at the origin.
Declaration
public static Shape Box(uint color = 4286356991)
Parameters
| Type |
Name |
Description |
| uint |
color |
|
Returns
|
Edit this page
View Source
Cylinder(uint)
Creates a cached unit cylinder centered at the origin.
Declaration
public static Shape Cylinder(uint color = 4286174913)
Parameters
| Type |
Name |
Description |
| uint |
color |
|
Returns
|
Edit this page
View Source
FromMesh(Mesh, Material?)
Creates an instance sharing an immutable indexed mesh.
Declaration
public static Shape FromMesh(Mesh mesh, Material? material = null)
Parameters
Returns
|
Edit this page
View Source
Group(params Shape[])
Creates an immutable group. Children are copied; maximum hierarchy depth is 64.
Declaration
public static Shape Group(params Shape[] children)
Parameters
| Type |
Name |
Description |
| Shape[] |
children |
|
Returns
|
Edit this page
View Source
Line(Vector3, Vector3, float, uint)
Creates a cylindrical line between distinct finite endpoints. Thickness is a world-space diameter.
Declaration
public static Shape Line(Vector3 start, Vector3 end, float thickness = 0.03, uint color = 4286356991)
Parameters
Returns
|
Edit this page
View Source
Named(string?)
Returns a copy with an application identifier.
Declaration
public Shape Named(string? name)
Parameters
| Type |
Name |
Description |
| string |
name |
|
Returns
|
Edit this page
View Source
Pyramid(uint)
Creates a cached unit pyramid centered at the origin.
Declaration
public static Shape Pyramid(uint color = 4293170635)
Parameters
| Type |
Name |
Description |
| uint |
color |
|
Returns
|
Edit this page
View Source
Rotated(float, float, float)
Returns a copy with absolute Euler angles in radians, preserving position and size.
Declaration
public Shape Rotated(float x, float y, float z)
Parameters
Returns
|
Edit this page
View Source
Scaled(float)
Returns a copy with a uniform size; repeated calls replace the previous size.
Declaration
public Shape Scaled(float size)
Parameters
| Type |
Name |
Description |
| float |
size |
|
Returns
|
Edit this page
View Source
Scaled(float, float, float)
Returns a copy with absolute positive dimensions, preserving position and rotation.
Declaration
public Shape Scaled(float x, float y, float z)
Parameters
Returns
|
Edit this page
View Source
Sphere(uint)
Creates a cached unit sphere centered at the origin.
Declaration
public static Shape Sphere(uint color = 4294950000)
Parameters
| Type |
Name |
Description |
| uint |
color |
|
Returns
|
Edit this page
View Source
WithMaterial(Material)
Returns a copy with a different immutable material.
Declaration
public Shape WithMaterial(Material material)
Parameters
Returns