Vous êtes sur la page 1sur 3

H ow to cal culate a suitab l

e
origin for a rotate d m ode l

Determining the rotation angles and axes for a rotated model is usually
straightforward. However calculating a suitable origin and model extent requires
some thought and some 3D coordinate geometry. Therefore a macro is available
to assist with these calculations, and a listing is given overleaf. You can also
download a copy from the Datamine Australia support web site
(www.datamine.com.au)

The volume that the rotated model is required to


cover is usually available as a set of XYZ data
points. For example, if a wireframe has been
fitted to the orebody outline then the wireframe
points file (XP,YP,ZP) could be used. Another
example would be the desurveyed sample data
(X,Y,Z). If a suitable file is not available, then it
is easy to create a file containing fields X,Y,Z
and to enter some data records to define
approximately the limits of the rotated model.
INPFIL or AED could be used for this.

The data file is first rotated through the required angles using CDTRAN. The
origins are set to 0,0,0 for both the original and the rotated data. The minimum
and maximum of the new X,Y,Z values can then be calculated using the STATS
and FIELD commands. A user defined value can be subtracted from each
minimum and added to each maximum to provide a margin around the volume.

Next define a temporary file containing three fields X,Y,Z with one record, with
values equal to the minimum values in the rotated system. These minimum
values are the origin of the rotated model in the rotated system. If these values
are rotated (CDTRAN) using the inverse rotation (@INVERSE=1), then the new
values will be the required origin in the world (non rotated) coordinate system.
The corresponding origin in the rotated system will be 0,0,0.

The extent of the model in each direction is calculated by subtracting the


minimum from the maximum. This can then be divided into a suitable number of
cells and a suitable cell size for each direction.

Datamine Australia: support@datamine.com.au


!START M1 Calculation of Model Origin & Extent for a Rotated Model
!PROMPT
0 Calculation of Rotation Origin and Model Extent
0 -----------------------------------------------
1 Rotation 1: Angle >'$ANG1#',N,-360,360
1 Axis >'$RAX1#',N,1,3,1,2,3
1 Rotation 2: Angle >'$ANG2#',N,-360,360
1 Axis >'$RAX2#',N,0,3,0,1,2,3
1 Rotation 3: Angle >'$ANG3#',N,-360,360
1 Axis >'$RAX3#',N,0,3,0,1,2,3
0
1 Name of file containing XYZ data >'$FILE1#' ,A,9
0 What are the field names of the XYZ coordinates in this file?
1 X field name [XP] >'$X#' ,A,8
1 Y field name [YP] >'$Y#' ,A,8
1 Z field name [ZP] >'$Z#' ,A,8
1 Define a margin around the data values [$MARG#] >'$MARG#',N,0
!REM Transform the data with all origin values set to zero
!CDTRAN &IN($FILE1#),&OUT(T1),*X($X#),*Y($Y#),*Z($Z#),
*NEWX(X),*NEWY(Y),*NEWZ(Z),@INVERSE=0,
@ANGLE1=$ANG1#, @ANGLE2=$ANG2#, @ANGLE3=$ANG3#,
@ROTAXIS1=$RAX1# ,@ROTAXIS2=$RAX2#,@ROTAXIS3=$RAX3#,
@X0=0,@Y0=0,@Z0=0,@XR0=0,@YR0=0,@ZR0=0

!REM Find the XYZ min & max in the transformed system.
!STATS &IN(T1),&OUT(T2),*F1(X),*F2(Y),*F3(Z)
!FIELD $EXIST#=T2,$RECS#=1,$XMIN#=MINIMUM,$XMAX#=MAXIMUM
!FIELD $EXIST#=T2,$RECS#=2,$YMIN#=MINIMUM,$YMAX#=MAXIMUM
!FIELD $EXIST#=T2,$RECS#=3,$ZMIN#=MINIMUM,$ZMAX#=MAXIMUM
!REM Add the margin
!LET $XMIN#={$XMIN#-$MARG#}
!LET $XMAX#={$XMAX#+$MARG#}
!LET $YMIN#={$YMIN#-$MARG#}
!LET $YMAX#={$YMAX#+$MARG#}
!LET $ZMIN#={$ZMIN#-$MARG#}
!LET $ZMAX#={$ZMAX#+$MARG#}

!REM Inverse transform on the minimum values


!INPFIL &OUT(T3)
minimum values
X N Y 0
Y N Y 0
Z N Y 0
]
OK
# no system file
$XMIN# ,$YMIN#,$ZMIN#
!CDTRAN &IN(T3),&OUT(T4),*X(X),*Y(Y),*Z(Z),*NEWX(X),*NEWY(Y),*NEWZ(Z),
@ANGLE1=$ANG1#, @ANGLE2=$ANG2#, @ANGLE3=$ANG3#,
@ROTAXIS1=$RAX1# ,@ROTAXIS2=$RAX2#,@ROTAXIS3=$RAX3#,
@X0=0,@Y0=0,@Z0=0,@XR0=0,@YR0=0,@ZR0=0,@INVERSE=1
!FIELD $EXIST#=T4,$RECS#=1,$XORIG#=X,$YORIG#=Y,$ZORIG#=Z
!PROMPT
0 The recommended origin in world coordinates is:
0 X = $XORIG# Y = $YORIG# Z = $ZORIG#
Datamine Australia: support@datamine.com.au
0 The extent (XINC*NX, etc) of the model in the rotated system is:
0 X = {$XMAX#-$XMIN#} Y = {$YMAX#-$YMIN#} Z = {$ZMAX#-$ZMIN#}
!END

Datamine Australia: support@datamine.com.au

Vous aimerez peut-être aussi