I am currently studying the properties of the conical face to automatically retreive some information from a model of mine. One key property I would need tp receive, would be the minim and maximum radius of the cone.
Does anyone know which radius the "askfacedata" of the cone gets? For the cones I tested, the value of this radius seems rather strange. Or is there maybe another way to get the minimum and maximum radius of the face?
I am looking forward to hearing from you!
PS: If not, is there maybe a way to get the length of the cone? An "askmaximum" distance function might also come in handy to calculate those values
Solved! Go to Solution.
One of the outputs of .AskFaceData is a point coordinate; for a conical face, this point lies somewhere on the axis of the cone. The radius that is returned represents the radius at this point (take a planar section of the conical face normal to the axis, passing through this point and measure the radius).
If the face is a result of a cone feature, you can use a cone feature builder object to query the top and bottom radius.
If the face is a result of a through curve or revolve feature, you might be able to get or calculate the radii from the section curves.
If all you have to work with is the face, you could get the edges from the face and test to see if they are arcs. If the edges are not arcs, you could use .AskFaceProps to get the radius at a particular parameter location on the face. Finding the correct parameter locations in this case could be tricky.
Finding the length of the cone: one potential method would be to use the .AskBoundingBoxAligned method - pass in a csys where one of the axes is parallel to the cone axis and read the box size along that axis. Or, use "measure extremes" along with the cone axis to calculate the length.
@cowski1 Thank you very much for your reply! Since I just have the face, I might have to go the hard way of looking at the edges or the even the points as you mentioned, but I think that might be my only option at this point.
When speaking about the BoundingBox I would have one more question: The AskBoundingBox will get the bounding box in the global coordinate system and AskBoundingBoxAligned will provide the bounding box in the coordinate system, I provide, right? But there is no such function to get a minimum box around the body, that is not aligned to anything or just one axis right?
When speaking about the BoundingBox I would have one more question: The AskBoundingBox will get the bounding box in the global coordinate system and AskBoundingBoxAligned will provide the bounding box in the coordinate system, I provide, right?
But there is no such function to get a minimum box around the body, that is not aligned to anything or just one axis right?
There is no function that will find the orientation of the absolute smallest required bounding box for a given object.
An orientation can be defined given 2 vectors (2 axes of the csys). Given the known axis of the conical face, you could use .AskPerpendicular to find an axis perpendicular to the one given. Using these 2 vectors, you can create a csys for use with .AskBoundingBoxAligned. Alternately, you can create an orientation given an origin point and an axis direction. So, technically, yes - you'll need more than 1 axis to find the bounding box; but the API has the tools to get you there.