| Author |
Message |
ken666
Guest
|
Posted:
Wed Apr 06, 2005 9:03 am Post subject:
Is there a way to get geometric data from 3D solids?? |
|
|
Is there a way to get geometric data from 3D solids??
I know that there are mass properties, but they are not really usefull. It's impossible to find out what kind of primitive(sphere, box, ...) the solid is.
I just want to retrieve regular properties from a box, like height, width, ...
There's a getBoundingBox method, but when you rotate the solid, this method becomes useless.
tanks in advance
|
|
| Back to top |
|
 |
Joe Sutphin
Guest
|
Posted:
Wed Apr 06, 2005 6:06 pm Post subject:
Re: Is there a way to get geometric data from 3D solids?? |
|
|
I do not believe this will be possible using VBA.
Joe
--
"ken666" <nospam@address.withheld> wrote in message
news:10629271.1112775466164.JavaMail.jive@jiveforum1.autodesk.com...
| Quote: | Is there a way to get geometric data from 3D solids??
I know that there are mass properties, but they are not really usefull.
It's impossible to find out what kind of primitive(sphere, box, ...) the
solid is.
I just want to retrieve regular properties from a box, like height, width,
...
There's a getBoundingBox method, but when you rotate the solid, this
method becomes useless.
tanks in advance |
|
|
| Back to top |
|
 |
antmjr
Guest
|
Posted:
Wed Apr 06, 2005 7:44 pm Post subject:
Re: Is there a way to get geometric data from 3D solids?? |
|
|
to manage whatever solid, you must be able to read (that’s easy) and work out his ACIS codes; I think is really difficult, not to say impossible, with VBA and a scientific knowledge like mine. A simpler task is to draw a solid from scratch (VBA creates 3Dprimitives in the WCS origin), then to move/rotate it by using .TransformBy and a transformation matrix. You may want to store this matrix (or simply the X Y and Z vectors) in the solid as extended data for further use. Of course if you rotate or mirror that solid without updating his stored matrix, the whole strategy goes to hell. One could define an object level event for that solid, so that if it will be moved, an event will update his matrix, but I for one have always had bad experiences with events. Maybe it’s easier to prevent from moving that solid with normal commands such as ‘rotate’ 'mirror' and so on, and to build your own commands instead. Or if you are lazy and you are working for yourself alone, as my case is, simply remember what you haven’t to do
If your solid is always a true parallelepiped, with all the opposite faces parallel each other, the .PrincipalDirections gives you a possible X vector. If your box has always two vertical faces (i.e. it always lies on a vertical plan) you can easily find his transformation matrix (crossproduct of PrincipalDirections by WCS_Zvector gives you the Y vector; then Y vector by .PrincipalDirections will give you the Z vector). Unfortunately if you have to modify the box, as it happens with, say, rafters or beams, which are often sliced or moulded at the ends, the .PrincipalDirections may deviate from the axis of the beam, and isn’t usable for this task
To measure this solid with BoundingBox, translate a copy of it to the origin and rotate it so that it lies in the right position; you need the transposed matrix of the matrix you may have stored in the solid. Otherwise you have to pick 3 meaningful points on the solid (for instance 2 points on a longitudinal edge and a third point to define the plan on which the solid lies) and calculate the matrix and the transposed matrix from them.
Copy and .TransformBy transposed_matrix; then GetBoundingBox and .Delete
|
|
| Back to top |
|
 |
|
|
|
|