Skip to main content
18-Opal
Aug 25, 2021 2:06 AM UTC
Question

How to check the cylindrical shape?

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.

6 replies

1-Visitor
Jan 3, 2022 9:07 AM UTC

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.

Translate
FV_01
Jan 4, 2022 4:21 PM UTC

$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...  

Translate
1-Visitor
Jan 5, 2022 3:43 AM UTC

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. 

 

Translate
17-Peridot
Jan 10, 2022 6:16 AM UTC

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;

 

Translate