|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
7 O9 g) f/ l& e( q* a4 ONX二次开发源码分享: 在绝对坐标系和视图上点映射) E+ m8 D+ _3 C& w
}+ p4 m2 u! z6 `$ n9 @* n! G0 n( q5 U. g4 r* Z
[mw_shl_code=c,true]& d- F" D1 [( [5 ]" E, {
Function MapView2Abs(ByVal aView As View, ByVal coords As Point3d)
( j( j F- Z9 p% e$ q! R Dim vmx As Matrix3x3 = aView.Matrix$ j, k. ~1 G4 T
Dim vw() As Double = {0, 0, 0, vmx.Xx, vmx.Xy, vmx.Xz, vmx.Yx, vmx.Yy, vmx.Yz}
/ i1 b; M0 \/ ^3 N: X Dim abs() As Double = {0, 0, 0, 1, 0, 0, 0, 1, 0}
" j$ }4 u& i0 p' |8 o! L, L Dim mx(11) As Double
8 u) v5 p0 }: J* r. X/ s Dim irc As Integer3 e0 V6 R, o2 T3 [( |8 g
Dim c() As Double = {coords.X, coords.Y, coords.Z}' p `/ d6 Z* j, f5 Q
, h) g! L2 v7 ~. c5 r ufs.Trns.CreateCsysMappingMatrix(vw, abs, mx, irc)6 Y+ O* Z! s k; G/ M" U6 d
ufs.Trns.MapPosition(c, mx)6 r: F9 g' J6 T
! M+ g9 }7 Y, g# [# _* m/ m3 J
MapView2Abs = New Point3d(c(0), c(1), c(2))
% ]) V# S5 b3 \7 a5 k% f& J1 o End Function5 I/ j* ?! z, A% c* j2 f
3 v3 s. u: B' k Function MapAbs2View(ByVal aView As View, ByVal coords As Point3d)
% f* y% L0 O A- I" C3 A8 ?; h* O Dim vmx As Matrix3x3 = aView.Matrix! t0 G( x3 A, W. ^+ _0 c. w! C
Dim vw() As Double = {0, 0, 0, vmx.Xx, vmx.Xy, vmx.Xz, vmx.Yx, vmx.Yy, vmx.Yz}; m; f7 G5 E+ Y; ~
Dim abs() As Double = {0, 0, 0, 1, 0, 0, 0, 1, 0}/ |1 d- j7 c0 `: |- n, l6 U8 H
Dim mx(11) As Double/ e0 t8 m" y( z2 [5 ? |$ O
Dim irc As Integer
* A% B$ ^( B) h1 i* y9 A Dim c() As Double = {coords.X, coords.Y, coords.Z}9 E8 R) w4 b/ r
, s( T$ E7 y6 s( U7 X ufs.Trns.CreateCsysMappingMatrix(abs, vw, mx, irc)
# }; C1 [0 }7 |) o ufs.Trns.MapPosition(c, mx)
, @" T! ?1 t: ], f, g4 J* ]- j; q. [5 r. N# k s
MapAbs2View = New Point3d(c(0), c(1), c(2))9 f$ V1 g. d( W0 |- _6 D
End Function
# L+ ?$ E, A0 J# l/ q" C[/mw_shl_code]
m" a+ l: Y% l- Z8 L% K9 C |
|