mxcad_2d API 文档 / 2d / MxCoordConvertType
Class: MxCoordConvertType
2d.MxCoordConvertType
坐标转换类型
Table of contents
Constructors
Methods
Constructors
constructor
• new MxCoordConvertType()
Methods
cad2doc
▸ cad2doc(pt
): McGePoint3d
cad坐标转文档坐标
Example
ts
import { MxCpp, McGePoint3d } from 'mxcad';
const mxcad = MxCpp.getCurrentCAD();
let pt1DOC = mxcad.cad2doc(new McGePoint3d(20,0,0));
console.log(pt1DOC)
Parameters
Name | Type | Description |
---|---|---|
pt | McGePoint3d | 三维点的对象 |
Returns
三维点的对象
cad2doc1
▸ cad2doc1(pt
): Vector3
cad坐标转文档坐标
Parameters
Name | Type | Description |
---|---|---|
pt | McGePoint3d | 三维点的对象 |
Returns
Vector3
THREE.js点对象
cad2doc2
▸ cad2doc2(x
, y
, z
): Vector3
cad坐标转文档坐标
Example
ts
import { MxCpp, McGePoint3d } from 'mxcad';
const mxcad = MxCpp.getCurrentCAD();
let pt = mxcad.cad2doc2(20,0,0);
console.log(pt)
Parameters
Name | Type | Description |
---|---|---|
x | number | X轴坐标 |
y | number | Y轴坐标 |
z | number | Z轴坐标 |
Returns
Vector3
THREE.js点对象
doc2cad
▸ doc2cad(pt
): McGePoint3d
文档坐标转cad坐标
Example
ts
import { MxCpp, McGePoint3d } from 'mxcad';
const mxcad = MxCpp.getCurrentCAD();
let pt1CAD = mxcad.doc2cad1(new McGePoint3d(20,0,0));
console.log(pt1CAD)
Parameters
Name | Type | Description |
---|---|---|
pt | McGePoint3d | 三维点的对象 |
Returns
三维点的对象
doc2cad1
▸ doc2cad1(pt
): McGePoint3d
文档坐标转cad坐标
Example
ts
import { MxCpp, McGePoint3d } from 'mxcad';
import THREE from "three"
const mxcad = MxCpp.getCurrentCAD();
let pt = mxcad.doc2cad1(new THREE.Vector3(20, 10));
console.log(pt)
Parameters
Name | Type | Description |
---|---|---|
pt | Vector3 | THREE.js点对象 |
Returns
三维点的对象
doc2cad2
▸ doc2cad2(x
, y
, z
): McGePoint3d
cad坐标转文档坐标
Example
ts
import { MxCpp, McGePoint3d } from 'mxcad';
import THREE from "three"
const mxcad = MxCpp.getCurrentCAD();
let pt = mxcad.doc2cad1(20, 10, 0);
console.log(pt)
Parameters
Name | Type | Description |
---|---|---|
x | number | X轴坐标 |
y | number | Y轴坐标 |
z | number | Z轴坐标 |
Returns
三维点的对象