editor › Globals › OFFConversion
Class: OFFConversion
Convert OFF <-> Mesh.
Hierarchy
↳ OFFConversion
Index
Methods
- _addMeshToBuilder
- exportMeshes
- exportPolygons
- exportSurfaces
- fromFile
- importBuffer
- importBufferToPolygons
- _meshPointToAssemblySpace
Methods
Private _addMeshToBuilder
▸ _addMeshToBuilder(builder: OFFBuilder, mesh: Mesh): void
Defined in src/util/3DFormatConversion/OFFConversion.ts:92
Parameters:
| Name | Type |
|---|---|
builder |
OFFBuilder |
mesh |
Mesh |
Returns: void
exportMeshes
▸ exportMeshes(meshes: Mesh[], internalFormat: boolean, roundPoints: boolean): string
Overrides Abstract3DFormatConversion.exportMeshes
Defined in src/util/3DFormatConversion/OFFConversion.ts:25
Returns global coordinates, not mesh-local.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
meshes |
Mesh[] | - | - |
internalFormat |
boolean | true | - |
roundPoints |
boolean | false | - |
Returns: string
exportPolygons
▸ exportPolygons(polygons: ReadonlyVectorPolygon3D[], internalFormat: boolean): string
Defined in src/util/3DFormatConversion/OFFConversion.ts:38
Just pastes the polygons into the off, no checks for two-manifoldness. Good for debugging.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
polygons |
ReadonlyVectorPolygon3D[] | - | - |
internalFormat |
boolean | true | - |
Returns: string
exportSurfaces
▸ exportSurfaces(surfaces: MeshSurface[], internalFormat: boolean): string
Defined in src/util/3DFormatConversion/OFFConversion.ts:51
Just pastes the surfaces into the off, no checks for two-manifoldness. Good for debugging.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
surfaces |
MeshSurface[] | - | - |
internalFormat |
boolean | true |
Returns: string
fromFile
▸ fromFile(filename: string): Mesh[]
Defined in src/util/3DFormatConversion/OFFConversion.ts:86
Obviously does not work in browser.
Parameters:
| Name | Type | Description |
|---|---|---|
filename |
string | - |
Returns: Mesh[]
importBuffer
▸ importBuffer(data: Buffer, skipPolygonValidationChecks: boolean): Mesh[]
Overrides Abstract3DFormatConversion.importBuffer
Defined in src/util/3DFormatConversion/OFFConversion.ts:65
Reads the off format contained in data as UTF-8 encoding and converts the described meshes to a halfedge data structure.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
data |
Buffer | - | - |
skipPolygonValidationChecks |
boolean | false | whether to check for valid polygons when constructing the meshes or not, only set to true when absolutely sure your polygons are correct for increased performance |
Returns: Mesh[]
importBufferToPolygons
▸ importBufferToPolygons(data: Buffer): Vector3[][][]
Defined in src/util/3DFormatConversion/OFFConversion.ts:76
Parameters:
| Name | Type |
|---|---|
data |
Buffer |
Returns: Vector3[][][]
Static Private _meshPointToAssemblySpace
▸ _meshPointToAssemblySpace(mesh: IPositionableElement, point: ReadonlyVector3): Vector3
Defined in src/util/3DFormatConversion/OFFConversion.ts:15
Parameters:
| Name | Type |
|---|---|
mesh |
IPositionableElement |
point |
ReadonlyVector3 |
Returns: Vector3