[mxcad_2d API documentation] (../README. md)/[2d] (../modules/2d. md)/McGeBound
Class: McGeBound
2d.McGeBound
Scope Object
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new McGeBound(pts?)
Constructor.
Parameters
| Name | Type | Description |
|---|---|---|
pts? | [McGePoint3dArray] (2d. McGePoint3dArray. md) \ | [McGePoint3d] (2d. McGePoint3d. md) [] |
Example
ts
import { McGeBound, McGePoint3d } from "mxcad"
const points = [new McGePoint3d(1, 2, 3), new McGePoint3d(4, 5, 6)];
const bound = new McGeBound(points);Properties
isValid
• isValid: boolean
Is it effective
Example
ts
import { McGeBound } from "mxcad"
//Create a McGeBound instance
const bound = new McGeBound();
//Accessing whether the attribute is valid and setting its value
bound.isValid = true;;maxPoint
• maxPoint: McGePoint3d
maximum point
Example
ts
import { McGeBound, McGePoint3d } from "mxcad"
//Create a McGeBound instance
const bound = new McGeBound();
//Access the maximum point attribute and set its value
bound.maxPoint = new McGePoint3d(20, 10, 0);minPoint
• minPoint: McGePoint3d
minimum point
Example
ts
import { McGeBound, McGePoint3d } from "mxcad"
//Create a McGeBound instance
const bound = new McGeBound();
//Access the minimum point attribute and set its value
bound.minPoint = new McGePoint3d(0, 0, 0);Methods
addPoint
▸ addPoint(pt): void
Add a point
Parameters
| Name | Type | Description |
|---|---|---|
| Pt | McGePoint3d (2d. McGePoint3d. md) | 3D point object |
Returns
void
Example
ts
import { McGeBound, McGePoint3d } from "mxcad"
//Create a McGeBound instance
const bound = new McGeBound();
//Add a point to the boundary
const point = new McGePoint3d(3, 4, 5);
bound.addPoint(point);addPoints
▸ addPoints(pts): void
Add a set of points
Parameters
| Name | Type | Description |
|---|---|---|
pts | McGePoint3dArray | McGePoint3d[] | 3D point object array |
Returns
void
Example
ts
import { McGeBound } from "mxcad"
//Create a McGeBound instance
const bound = new McGeBound();
//Create a set of points
const points = [new McGePoint3d(1, 2, 3), new McGePoint3d(4, 5, 6), new McGePoint3d(7, 8, 9)];
//Add a set of points to the boundary
bound.addPoints(points);