How to find the area of a cylindrical surface?

sjwa

CAD practitioner
I have passed the brepadaptor_ The surface instance gets GP_ Cylinder type cylindrical surface, how to calculate the area of the cylindrical surface?
(of course I've got the radius of the cylinder)
 

Quaoar

Administrator
Staff member
Code:
double ComputeArea(const TopoDS_Shape& shape)
{
  GProp_GProps props;
  BRepGProp::SurfaceProperties(shape, props, 1.0e-2);
  //
  return props.Mass();
}
 

sjwa

CAD practitioner
Code:
double ComputeArea(const TopoDS_Shape& shape)
{
  GProp_GProps props;
  BRepGProp::SurfaceProperties(shape, props, 1.0e-2);
  //
  return props.Mass();
}
thank you for your reply, Quaoar
I have been in contact with OCC for less than 3 weeks, I have a very naive question, but I still hope you can answer me:
As shown in the two images below:
I want to judge whether two separate cylinders are combined together to form a complete cylinder. My idea is to find the point marked in the second picture, and then compare the 3D coordinates of these two points, but I don't know how to find that point?
Do you have a good solution? Or do you have other solutions?
Thank you all , JSlyadne, Quaoar, natalia
1661478866667.png
1661479139870.png
 

sjwa

CAD practitioner
Maybe my question is a bit confusing
1.1 The initial problem I encountered was: how to judge this cylindrical surface is complete?
1.2 My solution is: find the area of the cylindrical surface, and then compare it with the complete area.
2.1 Next, I encountered a second problem: the circular holes of some parts are formed by splicing two cylindrical surfaces, just like the above picture, I need to judge that these two cylindrical surfaces are also complete, how? What to do?
2.2 My solution is: find the axis or center point of each half of the cylinder, and judge by comparing the axes or center points of the two
3. The question now is, what kind of parameter is the axis or center point mentioned above in OCC, and how to implement it?
This is a problem I am currently encountering, please also give me some valuable insights, thank you
@JSlyadne, @Quaoar, @natalia and every friends
 

JSlyadne

Administrator
Staff member
Hello @sjwa, I believe what you're trying to achieve is very similar to how AnalysisSitus treats the drill holes, at least some of steps you pointed out are implemented there. Do you have the sources of AnalysisSitus? Look at this method:

bool asiAlgo_RecognizeDrillHolesRule::recognize(TopTools_IndexedMapOfShape& featureFaces,
TColStd_PackedMapOfInteger& featureIndices)

To get more about recognition of the various features out of the solids, including holes, check out http://analysissitus.org. Good to start with http://analysissitus.org/features/features_recognition-principles.html as a general overview.
 

sjwa

CAD practitioner
Hello @sjwa, I believe what you're trying to achieve is very similar to how AnalysisSitus treats the drill holes, at least some of steps you pointed out are implemented there. Do you have the sources of AnalysisSitus? Look at this method:



To get more about recognition of the various features out of the solids, including holes, check out http://analysissitus.org. Good to start with http://analysissitus.org/features/features_recognition-principles.html as a general overview.
ok, thanks for your reply, i downloaded AnalysisSitus before, i tried to read the information in the link
thanks,JSlyadne
 
Top