cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

How to check the cylindrical shape?

CHASEONHO
18-Opal

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 6

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.

FV
17-Peridot
17-Peridot
(To:Manoj_Kumar_KP)

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

Manoj_Kumar_KP
4-Participant
(To:FV)

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. 

 

RPN
17-Peridot
17-Peridot
(To:FV)

My first, second and third Cent, you can‘t use the Outline alone to validate this.

  • Ask the User for Help, this will lead to a simple solution 🧐
  • Parse the surfaces from the first features, to see if you have 2 cylindrical ones, with the right normal. This may checked against the BBox. You need a lot of code, and if the model is not normal to the 3 planes you will loose always.
  • Probably you need some AI code to Analyse the Image 🥸
FV
17-Peridot
17-Peridot
(To:RPN)

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;

 

Top Tags