To further explain...The
WIPEOUT entity uses the same DXF Groups as an
IMAGE entity, however, rather than having an image composed of thousands of pixels, a wipeout uses only a
single pixel of the image.
When we provide the values for DXF Groups
11 &
12, we are specifying the
X &
Y vectors for the 'Pixel Coordinate System'.
For an
IMAGE entity, the length of these vectors would be the number of units in modelspace spanned by a single pixel of the image; for a
WIPEOUT entity, we are only using a
single pixel, hence the length of these vectors is equal to the largest dimension of the bounding box of the wipeout (since each pixel must be square) - in this case,
37 x 37.
Hence the vectors for the
X &
Y axes of the pixel coordinate system are
(37.0 0.0) &
(0.0 37.0); this equates to
(1.0 0.0) &
(0.0 1.0) under the pixel coordinate system.
We can then use the
trans function to account for a rotated UCS and transform these axis vectors accordingly; the way I visualise this is: "What does the UCS vector
(37.0 0.0) look like in WCS?" - the answer:
(trans '(37.0 0.0) 1 0) - resulting in a WCS axis vector rotated in accordance with the UCS.
Having defined the size and orientation of the pixel coordinate system we have a coordinate system represented by the following diagram:
The origin of this coordinate system is the centre of the pixel, with the positive X-axis direction to the right, and positive Y-axis direction to the base (don't ask me why Autodesk implemented it in reverse...)
The wipeout insertion point (DXF Group 10) is located in the bottom-left corner of this system, i.e. at
(-0.5, 0.5).
Each of the DXF Group 14 values are now expressed relative to this pixel coordinate system, as shown in the following diagram with your example wipeout displayed:
Since your wipeout was rectangular, we only needed to specify two corner points to define the wipeout:
(-0.5, -0.5) [top-left corner] &
(-0.5+1.5/37, 0.5) [bottom-right corner]Note that we could have equally used:
(-0.5, 0.5) [bottom-left corner] &
(-0.5+1.5/37, -0.5) [top-right corner]; however,
(-0.5, -0.5) is the default initial rectangular coordinate.
Notice also that to calculate the correct width for the wipeout we have use
1.5/37 since the 'pixel' has a width of
37 modelspace units, and we need to calculate the fraction represented by
1.5 units out of
37 (since the pixel has width
1).
If the wipeout were to be polygonal rather than rectangular, DXF Group 71 would need to be changed to
2, and every vertex of the polygon boundary needs to be represented by a DXF Group 14 pixel coordinate.
To calculate these coordinates you would calculate the vector from the centre of the pixel (i.e. the origin) to each vertex and divide the
X &
Y coordinates of this vector by the size of the pixel (
37 in this case), also remembering to negate the Y-coordinate.
I hope this explanation is somewhat clear, but please do ask if you require further clarification and I shall do my best to explain.
Lee