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

A collection of methods to applay subdivision rules to a MolaMesh. More...

Static Public Member Functions

static MolaMesh CatmullClark (MolaMesh mesh)
 Apply CatmullClark algorithm to a MolaMesh.
 
static MolaMesh Extrude (MolaMesh molaMesh, float height, bool capTop=true)
 Extrudes the all faces in a MolaMesh straight by a single distance height.
 
static MolaMesh Extrude (MolaMesh molaMesh, List< float > heights, List< bool > capTops)
 Extrudes the all faces in a MolaMesh straight by a list distance height.
 
static MolaMesh ExtrudeAlongVec (MolaMesh molaMesh, List< Vec3 > directions, List< float > heights, List< bool > capTops)
 Extrudes the all faces in a MolaMesh along a list of directions and by a list distance height.
 
static MolaMesh ExtrudeAlongVec (MolaMesh molaMesh, Vec3 direction, float height, bool capTop=true)
 Extrudes the all faces in a MolaMesh along a direction by a single distance height.
 
static MolaMesh ExtrudeTapered (MolaMesh molaMesh, float height, float fraction, bool capTop)
 Extrudes all face in a MolaMesh tapered like a window by creating an offset face and quads between every original edge and the corresponding new edge.
 
static MolaMesh ExtrudeTapered (MolaMesh molaMesh, List< float > heights, List< float > fractions, List< bool > capTops)
 Extrudes all face in a MolaMesh tapered like a window by creating an offset face and quads between every original edge and the corresponding new edge.
 
static MolaMesh ExtrudeToPointCenter (MolaMesh molaMesh, float height=0f)
 Extrude each face in a MolaMesh to a new point offset from its center by a distance along the normal vector of the face and create triangular faces from each edge to the point.
 
static MolaMesh ExtrudeToPointCenter (MolaMesh molaMesh, List< float > heightList)
 Extrudes each face in a MolaMesh to the center point moved by height normal to the face and creating a triangular face from each edge to the point.
 
static MolaMesh Grid (MolaMesh molaMesh, int nU, int nV)
 Splits all triangle or quad faces in a MolaMesh into regular grids.
 
static MolaMesh Grid (MolaMesh molaMesh, List< int > nUList, List< int > nVList)
 splits all triangle or quad faces in a MolaMesh into regular grids
 
static MolaMesh GridAbs (MolaMesh molaMesh, float x, float y)
 Subidivide each face in a MolaMesh into cells with absolute size.
 
static MolaMesh GridAbs (MolaMesh molaMesh, List< float > xList, List< float > yList)
 Subidivide each face in a MolaMesh into cells with absolute size.
 
static MolaMesh LinearSplitBorder (MolaMesh molaMesh, float borderWidth1=1f, float borderWidth2=1, int dir=0)
 Extrudes all face in a MolaMesh tapered like a window by creating an offset face and quads between every original edge and the corresponding new edge.
 
static MolaMesh LinearSplitQuad (MolaMesh molaMesh, float maxSplitWidth=1f, int dir=0)
 Split each face in a quad MolaMesh into three quads in one direction by specifying the max width of the segments.
 
static MolaMesh LinearSplitQuad (MolaMesh molaMesh, float minSplitWidth=0f, float maxSplitWidth=0.5f, int dir=0)
 Split each face in a quad MolaMesh into three quads in one direction by specifying the range to generate random widths of the first two segments.
 
static MolaMesh Relative (MolaMesh mesh, int startSplit, float minSplit1, float maxSplit1, float minSplit2, float maxSplit2)
 Split all faces in a MolaMesh based on relative parameters.
 
static MolaMesh SplitFrame (MolaMesh molaMesh, float w)
 Create an offset frame with quad corners from each face in a Molamesh.
 
static MolaMesh SplitFrame (MolaMesh molaMesh, List< float > wList)
 Create an offset frame with quad corners from each face in a Molamesh by specifying individual offset distances.
 
static MolaMesh SplitOffset (MolaMesh molaMesh, float offset)
 Offset each face in a MolaMesh by a distance.
 
static MolaMesh SplitOffset (MolaMesh molaMesh, IList< float > offsetList)
 Offset each face in a MolaMesh by specifying individual distances for each face.
 
static MolaMesh SplitRoof (MolaMesh molaMesh, float height=0f)
 Extrudes all faces in a MolaMesh into pitched rooves.
 
static MolaMesh SplitRoof (MolaMesh molaMesh, List< float > heightList)
 Extrude each face in a MolaMesh into pitched rooves by specifying individual extrusion heights for each face.
 

Detailed Description

A collection of methods to applay subdivision rules to a MolaMesh.

Member Function Documentation

◆ CatmullClark()

static MolaMesh CatmullClark ( MolaMesh mesh)
inlinestatic

Apply CatmullClark algorithm to a MolaMesh.

Parameters
meshA MolaMesh
Returns
The result MolaMesh

◆ Extrude() [1/2]

static MolaMesh Extrude ( MolaMesh molaMesh,
float height,
bool capTop = true )
inlinestatic

Extrudes the all faces in a MolaMesh straight by a single distance height.

Parameters
molaMeshA MolaMesh
heightExtruding height
capTopWether to cap the top or not
Returns
The result MolaMesh

◆ Extrude() [2/2]

static MolaMesh Extrude ( MolaMesh molaMesh,
List< float > heights,
List< bool > capTops )
inlinestatic

Extrudes the all faces in a MolaMesh straight by a list distance height.

The list length must much the face count.

Parameters
molaMeshA MolaMesh
heightA list Extruding height
capTopA list of bool to decide Wether to cap the top or not
Returns
The result MolaMesh

◆ ExtrudeAlongVec() [1/2]

static MolaMesh ExtrudeAlongVec ( MolaMesh molaMesh,
List< Vec3 > directions,
List< float > heights,
List< bool > capTops )
inlinestatic

Extrudes the all faces in a MolaMesh along a list of directions and by a list distance height.

The list length must much the face count.

Parameters
molaMeshA MolaMesh
directionsA list of Vec3
heightsA list Extruding height
capTopsA list of bool to decide Wether to cap the top or not
Returns
The result MolaMesh

◆ ExtrudeAlongVec() [2/2]

static MolaMesh ExtrudeAlongVec ( MolaMesh molaMesh,
Vec3 direction,
float height,
bool capTop = true )
inlinestatic

Extrudes the all faces in a MolaMesh along a direction by a single distance height.

Parameters
molaMeshA MolaMesh
directionA Vec3 for direction
heightExtruding height
capTopWether to cp the top or not
Returns
The result MolaMesh

◆ ExtrudeTapered() [1/2]

static MolaMesh ExtrudeTapered ( MolaMesh molaMesh,
float height,
float fraction,
bool capTop )
inlinestatic

Extrudes all face in a MolaMesh tapered like a window by creating an offset face and quads between every original edge and the corresponding new edge.

Parameters
molaMeshA MolaMesh
heightExtruding height
fractionA relative value
capTopA bool to decide Wether to cap the top or not
Returns
The result MolaMesh

◆ ExtrudeTapered() [2/2]

static MolaMesh ExtrudeTapered ( MolaMesh molaMesh,
List< float > heights,
List< float > fractions,
List< bool > capTops )
inlinestatic

Extrudes all face in a MolaMesh tapered like a window by creating an offset face and quads between every original edge and the corresponding new edge.

Parameters
molaMeshA MolaMesh
heightsA list of extruding height
fractionsA list of relative values
capTopsA list of bool to decide Wether to cap the top or not
Returns
The result MolaMesh

◆ ExtrudeToPointCenter() [1/2]

static MolaMesh ExtrudeToPointCenter ( MolaMesh molaMesh,
float height = 0f )
inlinestatic

Extrude each face in a MolaMesh to a new point offset from its center by a distance along the normal vector of the face and create triangular faces from each edge to the point.

Parameters
molaMeshThe MolaMesh
heightExtruding height
Returns
The result MolaMesh

◆ ExtrudeToPointCenter() [2/2]

static MolaMesh ExtrudeToPointCenter ( MolaMesh molaMesh,
List< float > heightList )
inlinestatic

Extrudes each face in a MolaMesh to the center point moved by height normal to the face and creating a triangular face from each edge to the point.

Parameters
molaMeshThe MolaMesh
heightListA list of extruding height
Returns
The result MolaMesh

◆ Grid() [1/2]

static MolaMesh Grid ( MolaMesh molaMesh,
int nU,
int nV )
inlinestatic

Splits all triangle or quad faces in a MolaMesh into regular grids.

Parameters
molaMeshA MolaMesh
nUDivision count on U direction
nVDevision count on V direction
Returns
The result MolaMesh

◆ Grid() [2/2]

static MolaMesh Grid ( MolaMesh molaMesh,
List< int > nUList,
List< int > nVList )
inlinestatic

splits all triangle or quad faces in a MolaMesh into regular grids

Parameters
molaMeshA MolaMesh
nUA list of int U
nVA list of int V

///

Parameters
nUDivision count on U direction
nVDevision count on V direction
Returns
The result MolaMesh

◆ GridAbs() [1/2]

static MolaMesh GridAbs ( MolaMesh molaMesh,
float x,
float y )
inlinestatic

Subidivide each face in a MolaMesh into cells with absolute size.

Parameters
molaMeshA MolaMesh
xSize on U direction
ySize on V direction
Returns
The result MolaMesh

◆ GridAbs() [2/2]

static MolaMesh GridAbs ( MolaMesh molaMesh,
List< float > xList,
List< float > yList )
inlinestatic

Subidivide each face in a MolaMesh into cells with absolute size.

Parameters
molaMeshA MolaMesh
xA list of size on U direction
yA list of size on V direction
Returns
The result MolaMesh

◆ LinearSplitBorder()

static MolaMesh LinearSplitBorder ( MolaMesh molaMesh,
float borderWidth1 = 1f,
float borderWidth2 = 1,
int dir = 0 )
inlinestatic

Extrudes all face in a MolaMesh tapered like a window by creating an offset face and quads between every original edge and the corresponding new edge.

Parameters
molaMeshA MolaMesh
heightExtruding height
fractionRelative value of how much the result is tapered
capTopWether to cap the top or not
Returns
The result MolaMesh

by specifying the range to generate random widths of the first two segments.

Parameters
molaMeshA MolaMesh
borderWidth1An absolute distance from one side of border
borderWidth2An absolute distance from one side of border
dir
Returns
The result MolaMesh

◆ LinearSplitQuad() [1/2]

static MolaMesh LinearSplitQuad ( MolaMesh molaMesh,
float maxSplitWidth = 1f,
int dir = 0 )
inlinestatic

Split each face in a quad MolaMesh into three quads in one direction by specifying the max width of the segments.

Parameters
molaMesh
maxSplitWidth
dir
Returns

◆ LinearSplitQuad() [2/2]

static MolaMesh LinearSplitQuad ( MolaMesh molaMesh,
float minSplitWidth = 0f,
float maxSplitWidth = 0::5f,
int dir = 0 )
inlinestatic

Split each face in a quad MolaMesh into three quads in one direction by specifying the range to generate random widths of the first two segments.

Parameters
molaMesh
minSplitWidth
maxSplitWidth
dir
Returns

◆ Relative()

static MolaMesh Relative ( MolaMesh mesh,
int startSplit,
float minSplit1,
float maxSplit1,
float minSplit2,
float maxSplit2 )
inlinestatic

Split all faces in a MolaMesh based on relative parameters.

Parameters
meshA MolaMesh
startSplitChoose U or V as starting direction
minSplit1min relative parameter on the first direction
maxSplit1max relative parameter on the first direction
minSplit2min relative parameter on the second direction
maxSplit2max relative parameter on the second direction
Returns
The result MolaMesh

◆ SplitFrame() [1/2]

static MolaMesh SplitFrame ( MolaMesh molaMesh,
float w )
inlinestatic

Create an offset frame with quad corners from each face in a Molamesh.

Only work for convex shapes.

Parameters
molaMeshThe MolaMesh
wThe relative value
Returns
The result MolaMesh

◆ SplitFrame() [2/2]

static MolaMesh SplitFrame ( MolaMesh molaMesh,
List< float > wList )
inlinestatic

Create an offset frame with quad corners from each face in a Molamesh by specifying individual offset distances.

Only work for convex shapes.

Parameters
molaMeshThe MolaMesh
wListA list of relative value
Returns
The result MolaMesh

◆ SplitOffset() [1/2]

static MolaMesh SplitOffset ( MolaMesh molaMesh,
float offset )
inlinestatic

Offset each face in a MolaMesh by a distance.

Only work for convex shapes.

Parameters
molaMeshA MolaMesh
offsetThe offset distance
Returns
The result MolaMesh

◆ SplitOffset() [2/2]

static MolaMesh SplitOffset ( MolaMesh molaMesh,
IList< float > offsetList )
inlinestatic

Offset each face in a MolaMesh by specifying individual distances for each face.

Only work for convex shapes.

Parameters
molaMeshA MolaMesh
offsetListA list of offset distance
Returns

◆ SplitRoof() [1/2]

static MolaMesh SplitRoof ( MolaMesh molaMesh,
float height = 0f )
inlinestatic

Extrudes all faces in a MolaMesh into pitched rooves.

Parameters
molaMeshA MolaMesh
heightExtruding height
Returns
The result MolaMesh

◆ SplitRoof() [2/2]

static MolaMesh SplitRoof ( MolaMesh molaMesh,
List< float > heightList )
inlinestatic

Extrude each face in a MolaMesh into pitched rooves by specifying individual extrusion heights for each face.

Parameters
molaMeshA MolaMesh
heightListThe list of extruding height
Returns
The result MolaMesh