Class representing a Plane.
Implements
Plane
Constructors
new Plane()
new Plane(
origin
,xDirection
?,yDirection
?):Plane
Create a Plane.
Parameters
• origin: Point
The origin point of the plane.
• xDirection?: null
| Point
= null
The x direction of the plane.
• yDirection?: Point
= ...
The y direction of the plane.
Returns
Properties
oc
protected
oc:OpenCascadeInstance
xDir
xDir:
Vector
Implementation of
IPlane.xDir
yDir
yDir:
Vector
Implementation of
IPlane.yDir
zDir
zDir:
Vector
Implementation of
IPlane.zDir
Accessors
origin
get
origin():Vector
Get the origin of the plane.
set
origin(newOrigin
):void
Set the origin of the plane.
Parameters
• newOrigin: Vector
The new origin of the plane.
Returns
The origin of the plane.
Implementation of
IPlane.origin
plane
get
plane():gp_Pln
Get the plane.
set
plane(plane
):void
Set the plane.
Parameters
• plane: gp_Pln
The new plane.
Returns
gp_Pln
The plane.
Implementation of
IPlane.plane
type
get
type():Type
Get the type of the plane.
Returns
Type
The type of the plane.
Implementation of
IPlane.type
Methods
adjust()
adjust(
newNormal
):Plane
Adjust the plane with a new normal.
Parameters
• newNormal: Vector
The new normal vector.
Returns
A new plane instance.
Implementation of
IPlane.adjust
align()
align(
direction
):object
Align the plane to a direction.
Parameters
• direction: Vector
The direction to align to.
Returns
object
The aligned plane and angle.
angle
angle:
number
plane
plane:
Plane
Implementation of
IPlane.align
clone()
clone():
Plane
Clone the plane.
Returns
A new plane instance.
Implementation of
IPlane.clone
closestPoint()
closestPoint(
point
):object
Find the closest point on the plane to a given point.
Parameters
• point: Vector
The point.
Returns
object
The closest point, distance, and UV point.
closestPoint
closestPoint:
Vector
distance
distance:
number
uvPoint
uvPoint:
Vector
Implementation of
IPlane.closestPoint
delete()
delete():
void
Deletes the plane and performs necessary cleanup operations.
Returns
void
Implementation of
IPlane.delete
dump()
dump():
string
Dump the plane information.
Returns
string
The plane information.
Implementation of
IPlane.dump
offset()
offset(
distance
):Plane
Offset the plane by a distance.
Parameters
• distance: number
The distance to offset.
Returns
A new plane instance.
Implementation of
IPlane.offset
reverse()
reverse(
xFlip
,yFlip
,swap
):Plane
Reverse the plane directions.
Parameters
• xFlip: boolean
Whether to flip the x direction.
• yFlip: boolean
Whether to flip the y direction.
• swap: boolean
Whether to swap the x and y directions.
Returns
A new plane instance.
Implementation of
IPlane.reverse
setOrigin2d()
setOrigin2d(
x
,y
):void
Set the origin of the plane in 2D.
Parameters
• x: number
The x coordinate.
• y: number
The y coordinate.
Returns
void
Implementation of
IPlane.setOrigin2d
toLocalCoords()
toLocalCoords(
vec
):Vector
Convert a vector to local coordinates.
Parameters
• vec: Vector
The vector.
Returns
The vector in local coordinates.
Implementation of
IPlane.toLocalCoords
toWorldCoords()
toWorldCoords(
v
):Vector
Convert a point to world coordinates.
Parameters
• v: Point
The point.
Returns
The point in world coordinates.
Implementation of
IPlane.toWorldCoords
by2Line()
static
by2Line(lineA
,lineB
):Plane
Create a plane by two lines.
Parameters
• lineA: Curve
The first line.
• lineB: Curve
The second line.
Returns
A new plane instance.
by3Pnt()
static
by3Pnt(origin
,pointA
,pointB
):Plane
Create a plane by three points.
Parameters
• origin: Vector
The origin point.
• pointA: Vector
The first point.
• pointB: Vector
The second point.
Returns
A new plane instance.
byLinePnt()
static
byLinePnt(line
,point
):Plane
Create a plane by a line and a point.
Parameters
• line: Curve
The line.
• point: Vector
The point.
Returns
A new plane instance.
byNormal()
static
byNormal(origin
,normal
):Plane
Create a plane by a normal vector.
Parameters
• origin: Vector
The origin point.
• normal: Vector
The normal vector.
Returns
A new plane instance.