|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
1 s: w4 x9 u5 Z+ uNX二次开发源码分享: 在绝对坐标系和视图上点映射
' Y7 T. c; h; P4 t2 N5 n4 _7 z
7 x- o1 F7 v: h& Z. m4 R
# x, e' V4 l9 L# P( B' M[mw_shl_code=c,true]
0 m) U! B3 B! ] Function MapView2Abs(ByVal aView As View, ByVal coords As Point3d)# [5 q4 P5 c+ O5 [" |
Dim vmx As Matrix3x3 = aView.Matrix
5 I+ o5 v3 q! E! A( ~ Dim vw() As Double = {0, 0, 0, vmx.Xx, vmx.Xy, vmx.Xz, vmx.Yx, vmx.Yy, vmx.Yz}
% |) Y& l) h+ K- Q ? Dim abs() As Double = {0, 0, 0, 1, 0, 0, 0, 1, 0}! t2 t& V+ D8 n( M( P
Dim mx(11) As Double6 s, c# e! a( L6 @
Dim irc As Integer8 O- s1 _9 }( |- h( ~$ M
Dim c() As Double = {coords.X, coords.Y, coords.Z}
% P: J3 \- Y2 j- `! i5 t1 D7 T0 q; F- P
ufs.Trns.CreateCsysMappingMatrix(vw, abs, mx, irc)4 P& U1 _- y' X% x
ufs.Trns.MapPosition(c, mx)
7 z5 _2 X1 S2 l7 W: Q1 g3 ~, y. A! E7 r: w! o* ~1 i1 @; k* o% b
MapView2Abs = New Point3d(c(0), c(1), c(2))
/ ~0 E: j( z9 K9 {4 f1 {( {, d End Function
+ G* \6 P8 M6 Z" T% o4 B$ t* d/ [6 U4 e" B) z
Function MapAbs2View(ByVal aView As View, ByVal coords As Point3d)
- N6 i$ g+ k- Q Dim vmx As Matrix3x3 = aView.Matrix: n5 m$ P# K- ~. s7 _8 Q
Dim vw() As Double = {0, 0, 0, vmx.Xx, vmx.Xy, vmx.Xz, vmx.Yx, vmx.Yy, vmx.Yz}
' H& G7 T, K% f( N; ? Dim abs() As Double = {0, 0, 0, 1, 0, 0, 0, 1, 0}
# d6 ]) V% \0 y$ y+ o Dim mx(11) As Double
5 E) m8 V$ n3 y& ? C3 d5 { Dim irc As Integer
, ^! `( p2 a; G9 s& n* F Dim c() As Double = {coords.X, coords.Y, coords.Z}
. ~# P/ U5 ?7 H3 K) x6 m5 d0 |; U4 P8 T/ P0 V) W% B* M
ufs.Trns.CreateCsysMappingMatrix(abs, vw, mx, irc)
% x- j4 m+ I; G+ S* }# n ufs.Trns.MapPosition(c, mx)
) c% m$ `* B* U2 V
$ E# u" Q, u2 C; `" K I; T MapAbs2View = New Point3d(c(0), c(1), c(2))
$ W7 Z6 w/ G* [: _6 l End Function. A I! v1 {: O* j
[/mw_shl_code]
$ v1 Z8 q. E. o& q+ @" t/ X" J8 Z* ] |
|