|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
. q# n9 _+ e' d) y. E% e& UNX二次开发源码分享: 在绝对坐标系和视图上点映射
% z+ c3 q4 `% D* ]5 }2 f; S
5 h- Y2 Z8 c2 K* d% |9 S {# L1 }9 ^% m
[mw_shl_code=c,true]
8 x! r' n. F0 J7 ^- a* i* | Function MapView2Abs(ByVal aView As View, ByVal coords As Point3d)* l5 d# F2 j- x$ i$ ^" |7 G7 E
Dim vmx As Matrix3x3 = aView.Matrix6 a$ H, F7 r5 b" \( Q
Dim vw() As Double = {0, 0, 0, vmx.Xx, vmx.Xy, vmx.Xz, vmx.Yx, vmx.Yy, vmx.Yz}
8 X) s& m( f# M) q Dim abs() As Double = {0, 0, 0, 1, 0, 0, 0, 1, 0}
3 c2 F% w0 T6 A Dim mx(11) As Double# G( _( r n( Q5 w1 N. l- x6 T% H
Dim irc As Integer
& [7 u% X( l" l7 k& C. \ Dim c() As Double = {coords.X, coords.Y, coords.Z}
( Z" ~/ A1 {2 M& G0 x
; I/ J) ^1 S! f/ Y0 f# T. [ ufs.Trns.CreateCsysMappingMatrix(vw, abs, mx, irc)2 p2 R' S% l( x5 I4 h4 f; \
ufs.Trns.MapPosition(c, mx), x- N) c! z4 y
6 P3 C* B3 e7 V, R$ A MapView2Abs = New Point3d(c(0), c(1), c(2))) x- Z" R5 z/ o* [
End Function; {9 }# |% t5 \+ `; E
0 m/ w, G. E _( _& C. ? Function MapAbs2View(ByVal aView As View, ByVal coords As Point3d)* Z6 I) G% J# f+ x' |+ E; ^
Dim vmx As Matrix3x3 = aView.Matrix
: J) @, r& ~$ x% f) ^% t Dim vw() As Double = {0, 0, 0, vmx.Xx, vmx.Xy, vmx.Xz, vmx.Yx, vmx.Yy, vmx.Yz}
6 j8 X* H& [( Q' q3 Q8 E [7 K Dim abs() As Double = {0, 0, 0, 1, 0, 0, 0, 1, 0}+ S. K* r; c, L8 @9 Y
Dim mx(11) As Double
4 h+ s2 j4 @; r( I& f# } Dim irc As Integer
3 A& `1 R k; m/ D7 v5 n" f _. { Dim c() As Double = {coords.X, coords.Y, coords.Z}: ?( r. I3 N T) b( [
3 `% x9 A; N4 N
ufs.Trns.CreateCsysMappingMatrix(abs, vw, mx, irc)
- {- W% {9 K& Q% G- H: @ ufs.Trns.MapPosition(c, mx)
8 c" Y5 A1 b X6 S3 Z/ U, f
& [7 F3 d! h7 ` MapAbs2View = New Point3d(c(0), c(1), c(2)) r* N5 v7 t, S
End Function
) T$ `& t& e0 f6 S) J/ N0 T[/mw_shl_code], A9 J$ i- w G$ A" t
|
|