Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X
Hi,
We calculate the outline size of the model through the "ProSolidOutlineCompute" function.
In the case of a cylinder, two values among the outer sizes of X, Y, and Z are the same.
However, if only two values of X, Y, and Z are the same, there is an error in judging it as a cylinder.
Any ideas on how to determine if a shape is circular?
Thanks ,
Warm Regards.
SeonHo Cha.
Hi CHASEONHO,
Use the function ProSolidOutlineGet() to get maximum and minimum values of the solid in all three axes of the coordinate system. Then, check whether any two axes' maximum and minimum values are the same. If it passes the above condition, it's a solid cylinder.
$0.02.
what about a prismatic extrusion with a square cross-section? ProSolidOutlineGet(...) will have at least two dimensions equal but the shape is definitely non-cylindrical...
Just put x-value and y-value in the circle equation (( x)^2 + ( y )^2 = r^2) and take (0,0) as center. Since ProSolidOutlineGet(...) gets values according to solid coordinate so we can make the center as (0,0) by putting the solid coordinate system in the center of the cylinder.
My first, second and third Cent, you can‘t use the Outline alone to validate this.
good answer.
One would only wish for shape recognition algorithms to be as simple as checking dimensions of the bounding box... But unfortunately, this is not the case.
You can check a surface type by
ProSurfaceTypeGet()
typedef enum pro_srf_type
{
PRO_SRF_NONE = -3,
PRO_SRF_PLANE = 34,
PRO_SRF_CYL = 36,
PRO_SRF_CONE = 37,
PRO_SRF_TORUS = 38,
PRO_SRF_COONS = 39,
PRO_SRF_SPL = 40,
PRO_SRF_FIL = 41,
PRO_SRF_RUL = 42,
PRO_SRF_REV = 43,
PRO_SRF_TABCYL = 44,
PRO_SRF_B_SPL = 45,
PRO_SRF_FOREIGN = 46,
PRO_SRF_CYL_SPL = 48,
PRO_SRF_SPL2DER = 50
} ProSrftype;