IShapeExtruder

Description

interface Tinman.Engine.Models.IShapeExtruder

Extended by

ShapeExtruder abstract

Base interface for classes that extrude 2D IShape objects to 3D IModelGeometrySimple objects.

The shape extruder takes a IShape and converts it to ShapeType.Graph (for the 3D lines) and ShapeType.Mesh (for the 3D triangles). Based on the configured geometry flags, lines and triangles are generated for the caps and the sides of the extrusion volume:

     +------(4)------+   (1) Cap End / Triangles
    /|              /|
   / | (1) +-------+ |   (2) Cap Start / Triangles
  /  |    /|       | |
 +-------+ |  (3)  | |   (3) Sides / Triangles
 |   |   | |       | |
 |   +---|-|-------|-+   (4) Cap End / Lines
(6) /    | |       |/
 | / (2) | +--(5)--+     (5) Cap Start / Lines
 |/      |/
 +-------+               (6) Sides / Lines

The CapEnd / CapStart and Sides flags affect the same 3D lines (see 4 and 5 in the figure above). If at least one flag is set, the 3D lines will be generated. The Toggle property can be used to further enable / disable specific 3D lines, which allows configuring all 64 possible geometry combinations.

Public / Methods

Defaults


public method Defaults → ()

returns → IShapeExtruder

this

Resets the shape extruder properties to their defaults.

After creation, a IShapeExtruder will always have default property values.

Extrude


public method Extrude → (2)

shape in : IShape

[not-null]
The 2D shape.

vertical in : RangeD

The vertical coordinate range.

returns → IModelGeometrySimple

The extruded 3D shape or null if empty.

Extrudes the given 2D shape.

Public / Attributes

Cap­End


public attribute CapEnd → (get,set)

value : bool

true to generate 3D geometry for the part, false to do not.

Generate 3D geometry for the cap at RangeD.End?

Defaults to true.

Cap­Start


public attribute CapStart → (get,set)

value : bool

true to generate 3D geometry for the part, false to do not.

Generate 3D geometry for the cap at RangeD.Start?

Defaults to true.

Lines


public attribute Lines → (get,set)

value : bool

true to generate 3D lines, false to do not.

Generate 3D lines?

Defaults to true.

Sides


public attribute Sides → (get,set)

value : bool

true to generate 3D geometry for the part, false to do not.

Generate 3D geometry at the extruded silhouette?

Defaults to true.

Texture


public attribute Texture → (get,set)

value : IShapeExtruderTexture

The IShapeExtruderTexture object to use. Set to null to skip generation of texture coordinates.

Specifies the IShapeExtruderTexture object to use for generating texture coordinates of the extruded model.

Defaults to null.

Toggle


public attribute Toggle → (get,set)

value : int32

The geometry force flags:
1 : toggle 3D lines for the cap at RangeD.End?
2 : toggle 3D lines for the cap at RangeD.Start?
4 : toggle 3D lines at the extruded silhouette?

Toggles generation of 3D geometry, i.e. if it is enabled by the other flags, toggling will disable it and vice versa.

Defaults to 0.

Triangles


public attribute Triangles → (get,set)

value : bool

true to generate 3D triangles, false to do not.

Generate 3D triangles?

Defaults to true.

Extensions

Extrude

2 overloads


public static method Extrude1 → (3)

shape in : IShape

[not-null]
The 2D shape.

verticalA in : float64

First boundary of vertical coordinate range.

verticalB in : float64

Second boundary of vertical coordinate range.

returns → IModelGeometrySimple

The extruded 3D shape or null if empty.

Extrudes the given 2D shape.


public static method Extrude2 → (2)

shape in : IShape

[not-null]
The 2D shape.

vertical in : float64

The vertical coordinate range.

returns → IModelGeometrySimple

The extruded 3D shape or null if empty.

Extrudes the given 2D shape.