HD Mola
 
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
MeshFactory Class Reference

A collection of methods to create MolaMEsh Premitives. More...

Static Public Member Functions

static MolaMesh CreateBox (float x1=0, float y1=0, float z1=0, float x2=1, float y2=1, float z2=1, Color? color=null)
 Creates and returns a mesh box with six quad faces.
 
static MolaMesh CreateCircle (float x, float y, float z, float radius, int nSegments, Color? color=null)
 Create and returns a circle mesh composed by triangles.
 
static MolaMesh CreateCone (float z1, float z2, float radius1, float radius2, int nSegments, bool capBottom=true, bool capTop=true, Color? color=null)
 Creates and returns a conic cylinder.
 
static MolaMesh CreateCone (Vec3 a, Vec3 b, int segments, float radius1, float radius2, bool capTop=true, bool capBottom=true, Color? color=null)
 Creates and returns a conic cylinder.
 
static MolaMesh CreateDodecahedron (float radius=1, float cx=0, float cy=0, float cz=0, Color? color=null)
 Constructs a dodecaheron mesh.
 
static MolaMesh CreateIcosahedron (float radius=1, float cx=0, float cy=0, float cz=0, Color? color=null)
 Creates and returns a mesh in the form of an icosahedron.
 
static MolaMesh CreateOctahedron (float edgeLen=1, float cx=0, float cy=0, float cz=0, Color? color=null)
 Constructs a octahedron mesh.
 
static MolaMesh CreateQuad (float dimX, float dimY, float x=0, float y=0, float z=0)
 Creates and returns a mesh with a single quad face.
 
static MolaMesh CreateQuad (float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, bool flip=false, Color? color=null)
 Creates and returns a mesh with a single quad face.
 
static MolaMesh CreateRhombicDodecahedron (float edge_length=1, float cx=0, float cy=0, float cz=0, Color? color=null)
 Constructs a rhombic dodecahedron mesh.
 
static MolaMesh CreateSingleFace (List< Vec3 > vertices)
 Creates and returns a single face mesh from the vertices.
 
static MolaMesh CreateSphere (float radius=1, float cx=0, float cy=0, float cz=0, int u_res=10, int v_res=10, Color? color=null)
 Constructs a uv sphere mesh.
 
static MolaMesh CreateTetrahedron (float size=1, float cx=0, float cy=0, float cz=0, Color? color=null)
 Constructs a tetrahedron mesh.
 
static MolaMesh CreateTorus (float ringRadius, float tubeRadius, int ringN=16, int tubeN=16, Color? color=null)
 Constructs a torus mesh.
 
static MolaMesh CreateTube (Vec3 a, Vec3 b, int segments, float radius)
 Creates and returns a tube MolaMesh.
 

Detailed Description

A collection of methods to create MolaMEsh Premitives.

Member Function Documentation

◆ CreateBox()

static MolaMesh CreateBox ( float x1 = 0,
float y1 = 0,
float z1 = 0,
float x2 = 1,
float y2 = 1,
float z2 = 1,
Color? color = null )
inlinestatic

Creates and returns a mesh box with six quad faces.

Parameters
x1
y1
z1
x2
y2
z2
color
Returns

◆ CreateCircle()

static MolaMesh CreateCircle ( float x,
float y,
float z,
float radius,
int nSegments,
Color? color = null )
inlinestatic

Create and returns a circle mesh composed by triangles.

Parameters
xX coordinate of the center point
yy coordinate of the center point
zz coordinate of the center point
radiusRadius of the circle
nSegmentsSegments of the circle
color
Returns
A circle shaped MolaMesh

◆ CreateCone() [1/2]

static MolaMesh CreateCone ( float z1,
float z2,
float radius1,
float radius2,
int nSegments,
bool capBottom = true,
bool capTop = true,
Color? color = null )
inlinestatic

Creates and returns a conic cylinder.

Parameters
z1
z2
radius1
radius2
nSegments
capBottom
capTop
color
Returns

◆ CreateCone() [2/2]

static MolaMesh CreateCone ( Vec3 a,
Vec3 b,
int segments,
float radius1,
float radius2,
bool capTop = true,
bool capBottom = true,
Color? color = null )
inlinestatic

Creates and returns a conic cylinder.

Parameters
a
b
segments
radius1
radius2
Returns

◆ CreateDodecahedron()

static MolaMesh CreateDodecahedron ( float radius = 1,
float cx = 0,
float cy = 0,
float cz = 0,
Color? color = null )
inlinestatic

Constructs a dodecaheron mesh.

Parameters
radius
cx
cy
cz
Returns

◆ CreateIcosahedron()

static MolaMesh CreateIcosahedron ( float radius = 1,
float cx = 0,
float cy = 0,
float cz = 0,
Color? color = null )
inlinestatic

Creates and returns a mesh in the form of an icosahedron.

Parameters
radius
cx
cy
cz
Returns

◆ CreateOctahedron()

static MolaMesh CreateOctahedron ( float edgeLen = 1,
float cx = 0,
float cy = 0,
float cz = 0,
Color? color = null )
inlinestatic

Constructs a octahedron mesh.

Parameters
edgeLen
cx
cy
cz
color
Returns

◆ CreateQuad() [1/2]

static MolaMesh CreateQuad ( float dimX,
float dimY,
float x = 0,
float y = 0,
float z = 0 )
inlinestatic

Creates and returns a mesh with a single quad face.

Parameters
dimX
dimY
x
y
z
Returns
A MolaMesh with a single quad face

◆ CreateQuad() [2/2]

static MolaMesh CreateQuad ( float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float x3,
float y3,
float z3,
float x4,
float y4,
float z4,
bool flip = false,
Color? color = null )
inlinestatic

Creates and returns a mesh with a single quad face.

Parameters
x1
y1
z1
x2
y2
z2
x3
y3
z3
x4
y4
z4
color
Returns
A MolaMesh with a single quad face

◆ CreateRhombicDodecahedron()

static MolaMesh CreateRhombicDodecahedron ( float edge_length = 1,
float cx = 0,
float cy = 0,
float cz = 0,
Color? color = null )
inlinestatic

Constructs a rhombic dodecahedron mesh.

Parameters
edge_length
cx
cy
cz
color
Returns

◆ CreateSingleFace()

static MolaMesh CreateSingleFace ( List< Vec3 > vertices)
inlinestatic

Creates and returns a single face mesh from the vertices.

Parameters
vertices
Returns

◆ CreateSphere()

static MolaMesh CreateSphere ( float radius = 1,
float cx = 0,
float cy = 0,
float cz = 0,
int u_res = 10,
int v_res = 10,
Color? color = null )
inlinestatic

Constructs a uv sphere mesh.

Returns

◆ CreateTetrahedron()

static MolaMesh CreateTetrahedron ( float size = 1,
float cx = 0,
float cy = 0,
float cz = 0,
Color? color = null )
inlinestatic

Constructs a tetrahedron mesh.

Returns

◆ CreateTorus()

static MolaMesh CreateTorus ( float ringRadius,
float tubeRadius,
int ringN = 16,
int tubeN = 16,
Color? color = null )
inlinestatic

Constructs a torus mesh.

Returns

◆ CreateTube()

static MolaMesh CreateTube ( Vec3 a,
Vec3 b,
int segments,
float radius )
inlinestatic

Creates and returns a tube MolaMesh.

Parameters
a
b
segments
radius
Returns