Class Grid snaps vertexes or meshes according to a given grid unit.Grid

Constructor

@:value({ objectSpace : false, unit : 1 })new(unit:Float = 1, objectSpace:Bool = false)

Grid snaps vertexes according to a given grid unit

Parameters:

unit

[optional] Number. The grid unit. Default is 1.

objectSpace

[optional] Boolean. Apply only to vertexes in geometry objectspace when Object3D are considered. Default is false.

Variables

unit:Float

Methods

snapMesh(mesh:Mesh):Void

Apply the grid code to a single mesh

Parameters:

mesh

Mesh. The mesh to snap to grid. Vertices are affected by default. Mesh position is snapped if grid.objectSpace is true;

@:value({ dovert : false })snapObject(object3d:ObjectContainer3D, dovert:Bool = false):Void

Apply the grid code to a given object3D. If type ObjectContainer3D, all children Mesh vertices will be affected.

Parameters:

object3d

Object3D. The Object3d to snap to grid.

dovert

[optional]. If the vertices must be handled or not. When false only object position is snapped to grid. Default is false.

snapVertices(vertices:Vector<Float>):Vector<Float>

Snaps to grid a given Vector.<Number> of vertices

Parameters:

vertices

Vector.<Number>. The vertices vector