The variable vec will be used to defined a coordinate system wherein the normal vector is perpendicular to the angle of the text (i.e. the WCS representation of the spf vector).
Variable vec, is the anchor of spf in the WCS, it has the same location and the same angle.
Than the z axis of the entity insertion point is translated from OCS to the coordinate system defined by vec, that’s because z axis is ruling x and y properties?
Below is a more accurate diagram to visualise the coordinate system constructed for sorting the selected text objects:
As for your other questions:
this code translating UCS to its cooriponding WCS,
spf is the vector, it being translated from translating from ______ vector to WCS
1._______ is something that i cant figure out, please help!
The expression:
(trans '(0.0 0.0 1.0) 1 0 t) constitutes the 'from' argument for the
trans function. This expression returns the normal vector of the UCS plane - the
trans function will then use the
Arbitrary Axis Algorithm to construct a coordinate system from this normal vector to use for the transformation.
2.why the program needs WCS equivlent?
Because the
trans function expects an extrusion vector argument to be expressed relative to WCS.
1. why the program gets only the Z coordinates rather the whole OCS?
Note that the program is
not retrieving the Z-coordinate of the insertion point expressed in the OCS of the text object, but rather the program uses the Z-coordinate of the insertion point expressed relative to the coordinate system defined by the normal vector 'vec' as shown in my diagram above.
2.why Z is being sorted?
Because in the coordinate system defined by the normal vector 'vec', each line of text resides at a different elevation.
The arbitrary axis algorithm is used by AutoCAD internally to implement the arbitrary but consistent generation of object coordinate systems for all entities that use object coordinates.
what they mean arbitery? randomly? and it can be connsistent?
Arbitrary does not imply random - the only requirement is that the same values are used for every calculation of the coordinate system such that the result is always consistent. However, there is nothing 'special' about these values, therefore, they are arbitrary values.
The parameters used within the
Arbitrary Axis Algorithm could be any values, providing the values are used consistently such that the same results are always obtained for a given input.
Given a unit-length vector to be used as the Z axis of a coordinate system, the arbitrary axis algorithm generates a corresponding X axis for the coordinate system. The Y axis follows by application of the right-hand rule.
as i understand, the algorithem get as an input the Z axie, and generate corresponding x and y, is that right?
Correct - three points (or two vectors) are strictly required to define a coordinate system, with the third axis calculated using the vector cross product such that it is perpendicular to the other two.
The
Arbitrary Axis Algorithm provides a means to construct a coordinate system from only
one extrusion/normal vector (halving the data storage requirements); this coordinate system is not strictly defined by the supplied extrusion vector (in this sense it is arbitrary), however, given the same extrusion vector, the
Arbitrary Axis Algorithm will construct the same coordinate system, which is all that matters as far as restoring the original data.
The method is to examine the given Z axis (also called the normal vector). If it is close to the positive or negative world Z axis, cross the world Y axis with the given Z axis to arrive at the arbitrary X axis. If it is not close, cross the world Z axis with the given Z axis to arrive at the arbitrary X axis. The boundary at which the decision is made was chosen to be both inexpensive to calculate and completely portable across machines. This is achieved by having a sort of “square” polar cap, the bounds of which are 1/64, which is precisely specifiable in six decimal-fraction digits and in six binary-fraction bits.
this is too far...what is 64/1?
1/64 is the arbitrary element of the
Arbitrary Axis Algorithm - this could be any value, providing the same value is always used.