Jump to content

Recommended Posts

Posted

When I get the property of a circle it display NormalX=0 NormalY = 0 NormalZ = 1.0

Please can you explane what is that. And after change the ucs it will change to some other values. After that all other circles (eaven newly drawn) get this value.

The problem is after changing the UCS I cant obtaind the correct value of the center coordinates by lisp.(CAD 2006)

Posted
The problem is after changing the UCS I cant obtaind the correct value of the center coordinates by lisp.(CAD 2006)

Please keep in mind that the coordinates in associated lists are in WCS coordinates. To have them in current UCS please check TRANS function.

Posted
Please keep in mind that the coordinates in associated lists are in WCS coordinates.

 

This is only true for non-planar entities (such as Lines, Points, 3D Polylines etc.) with some planar exceptions (Ellipse, MText), and extrusion vectors (DXF Group 210) which are always defined in WCS.

 

For most planar entities (Arc, Circle, LWPolyline, Insert, Text, Attrib etc.), the defining coordinates are expressed with respect to the OCS (Object Coordinate System) which is defined using the Arbitrary Axis Algorithm, given the normal (extrusion) vector for the entity (DXF Group 210).

Posted

Thanks gentlemen for explaining this.

  • 2 weeks later...
Posted

The plane which a circle lies is defined by the normal ( a vector perpendicular to the plane) and the distance that plane is from the WCS origin. A plane with a normal of x= 0, y = 0 , z = 1 is parallel to the XY plane. DXF code 210 stores a circle's normal. DXF code 38 the elevation (the distance the plane is from the origin). If you were to rotate the circle by 45° about the Y axis, the 210 code would read (210 -0.707 0.0 0.707), a vector pointing at 45° in the XZ plane. It should be noted that the 3DROTATE command follows right-hand rule convention for the X, Y, and Z axes, but the ROTATE3D command has a bug and uses a left-hand rule for only the Y axis when rotating an object in 3D space.

Posted

That might explain why I can never get my 3d rotations right first time. I always try to use a left-hand-rule!!!

 

dJE

Posted
The plane which a circle lies is defined by the normal ( a vector perpendicular to the plane) and the distance that plane is from the WCS origin. A plane with a normal of x= 0, y = 0 , z = 1 is parallel to the XY plane. DXF code 210 stores a circle's normal. DXF code 38 the elevation (the distance the plane is from the origin). If you were to rotate the circle by 45° about the Y axis, the 210 code would read (210 -0.707 0.0 0.707), a vector pointing at 45° in the XZ plane. It should be noted that the 3DROTATE command follows right-hand rule convention for the X, Y, and Z axes, but the ROTATE3D command has a bug and uses a left-hand rule for only the Y axis when rotating an object in 3D space.

 

The plane which a circle lies is defined by the normal ( a vector perpendicular to the plane) and the distance that plane is from the WCS origin defined by center point of circle. DXF code 38 the elevation (the distance the plane is from the origin), only if LWPOLYLINE is issued entity - if it's CIRCLE, as I said, center point position in space and DXF code 210 - normal vector of OCS plane, defines 3D space plane in witch lies circle...

 

As no one gave an example, here is used OCS of reference CIRCLE to extract OCS center coordinates into WCS center coordinates, using (trans) function and source OCS defined by DXF 210 and destination WCS - 0 integer for (trans) transformation point coordinates...

 

(defun c:circen ( / ss ci cen )
 (prompt "\nPick circle")
 (while (not ss)
   (setq ss (ssget "_+.:L:E:S" '((0 . "CIRCLE"))))
 )
 (setq ci (ssname ss 0))
 (setq cen (trans (cdr (assoc 10 (entget ci))) (cdr (assoc 210 (entget ci))) 0))
 (prompt "\nCenter of circle in WCS is : ") (princ cen)
 (princ)
)

 

M.R.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...