|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
/ }" x- x0 D: P* u- f) J' bNX二次开发源码分享: 在绝对坐标系和视图上点映射" I" u! E2 K! E+ g8 o$ a' S
; p- w( s4 j. e/ d% p
u' H5 R. y0 {+ v
[mw_shl_code=c,true]0 }% B5 f2 R/ I- x0 p/ O
Function MapView2Abs(ByVal aView As View, ByVal coords As Point3d)
; U, v8 Z5 s- Z- h Dim vmx As Matrix3x3 = aView.Matrix+ N$ s# w1 `% K" {
Dim vw() As Double = {0, 0, 0, vmx.Xx, vmx.Xy, vmx.Xz, vmx.Yx, vmx.Yy, vmx.Yz}& E- t$ ]' u4 M J! |7 r2 s$ ~) R1 e
Dim abs() As Double = {0, 0, 0, 1, 0, 0, 0, 1, 0}
$ h0 M d U' M9 E, o Dim mx(11) As Double5 }7 W* q+ d5 r U
Dim irc As Integer+ b* i- L; J1 o6 J/ ?& m3 N5 X
Dim c() As Double = {coords.X, coords.Y, coords.Z}" }+ [8 C7 z G
* R4 v4 y9 s& U9 N# w0 L
ufs.Trns.CreateCsysMappingMatrix(vw, abs, mx, irc): R+ j% H1 z& P' Z4 Y; l
ufs.Trns.MapPosition(c, mx)
B# i/ y/ ]* N# b* G
M4 E* v/ s7 A& k2 Z8 \ MapView2Abs = New Point3d(c(0), c(1), c(2)), U7 m7 u5 d3 H+ O7 z- Y
End Function
- ]$ V+ x8 ? o$ Z5 n# ?- k
, `# N0 X+ ]6 S* ^2 P6 Q Function MapAbs2View(ByVal aView As View, ByVal coords As Point3d)- ]2 ^$ |% @/ z
Dim vmx As Matrix3x3 = aView.Matrix# T; o k: u9 K
Dim vw() As Double = {0, 0, 0, vmx.Xx, vmx.Xy, vmx.Xz, vmx.Yx, vmx.Yy, vmx.Yz}
& Y( `) ]$ ~' R) h" v Dim abs() As Double = {0, 0, 0, 1, 0, 0, 0, 1, 0}
" x' Z4 E% N7 _+ E Dim mx(11) As Double
) U0 [& \4 Y$ ~ Dim irc As Integer5 Z( e/ C( X8 f
Dim c() As Double = {coords.X, coords.Y, coords.Z}
, l2 A; S' |# ^7 F% |1 \% b9 J x. C+ v+ Z+ P
ufs.Trns.CreateCsysMappingMatrix(abs, vw, mx, irc), [8 J3 Q! g" h' z
ufs.Trns.MapPosition(c, mx); L, L! V) J3 i
9 T( G. {* c2 ?! g" F
MapAbs2View = New Point3d(c(0), c(1), c(2))
( f: _3 |: m6 @; E7 G J End Function- |2 ?3 p: l' V9 G4 T
[/mw_shl_code]1 A3 j3 z: L5 T- q1 t* G# d5 a
|
|