Geom_CylindricalSurface defines a cylindrical surface, so it cannot on it's own define a solid cylinder, only a hollow cylinder. Solid cylinder should have two extra circles defined by planar surfaces, so that TopoDS_Solid cylinder consists of several TopoDS_Face's (with one of them defined by Geom_CylindricalSurface in case of canonical geometry).

Thank you, Kirill. This question has puzzled me for a long time. If I select a face, which geometry is a cylindrical surface, from a complex body, how can I tell if the direction of the face is pointing towards the axis of the cylinder, or the reverse way?

The same cylindrical surface can be a surface of a hole in the body, or it can be an external surface like a fillet. The face orientation makes all deal.

First you take a normal direction according to the geometry. Then you check the orientation of the face. If it is Reversed then you just reverse the normal. That's all.

To get normal vector you should compute cross product of vectors DU and DV got by the method D1. Or, alternatively, using the method GeomLib::NormEstim.

Let's the cylinder axis has origin point Ao, evaluated point on a surface (returned by D0 or D1) is P, normal vector at this point is N. Then the normal is outward if the dot product of the vectors (Ao,P) and N is positive.

I'v understood the method you mentioned. Thank you!

But I doubt whether it can be judged from the definition of cylindrical surface, such as coordinate system, parameters, etc.

Assuming that the normal direction of cylindrical surface A points inward, and the normal direction of cylindrical surface B points outward, Can the normal direction point to the inside or the outside be judged from the definition of the cylindrical surface?? In other words, what is the difference between the definitions of A and B?

Mon, 04/29/2002 - 18:40

Write this code:

Handle(Geom_CylindricalSurface) aSurf = new ...

// Construct its bounding wire

TopoDS_Wire aWire = ...

TopoDS_Face aFace(aSurf, aWire);

hAISContext->Display(new AIS_Shape(aFace));

You can then rotate it in your program to see if it is hollow or solid(use Shaded mode)

Thu, 05/02/2002 - 14:15

Hi,

Sorry, i don't want to see it on display. I want to programmatically find out if the cylindrical surface corresponds to hollow or filled...

shylesh

Mon, 05/09/2022 - 07:16

Hi, does anyone know the answer to this question? I had the same problem.

Mon, 05/09/2022 - 11:28

Geom_CylindricalSurfacedefines a cylindrical surface, so it cannot on it's own define a solid cylinder, only a hollow cylinder. Solid cylinder should have two extra circles defined by planar surfaces, so thatTopoDS_Solidcylinder consists of severalTopoDS_Face's (with one of them defined byGeom_CylindricalSurfacein case of canonical geometry).Tue, 05/10/2022 - 04:01

Thank you, Kirill. This question has puzzled me for a long time. If I select a face, which geometry is a cylindrical surface, from a complex body, how can I tell if the direction of the face is pointing towards the axis of the cylinder, or the reverse way?

Tue, 05/10/2022 - 13:45

The same cylindrical surface can be a surface of a hole in the body, or it can be an external surface like a fillet. The face orientation makes all deal.

First you take a normal direction according to the geometry. Then you check the orientation of the face. If it is Reversed then you just reverse the normal. That's all.

Tue, 05/10/2022 - 17:11

Thank you, Mikhail. how to take a normal direction of cylindrical surface? By the function Geom_CylindricalSurface::D1 or D2?

What I'm trying to figure out is that the normal direction of the cylindrical surface may point inward or outward, what determines this?

Tue, 05/10/2022 - 21:56

To get normal vector you should compute cross product of vectors DU and DV got by the method D1. Or, alternatively, using the method GeomLib::NormEstim.

Let's the cylinder axis has origin point Ao, evaluated point on a surface (returned by D0 or D1) is P, normal vector at this point is N. Then the normal is outward if the dot product of the vectors (Ao,P) and N is positive.

Wed, 05/11/2022 - 11:47

I'v understood the method you mentioned. Thank you!

But I doubt whether it can be judged from the definition of cylindrical surface, such as coordinate system, parameters, etc.

Assuming that the normal direction of cylindrical surface A points inward, and the normal direction of cylindrical surface B points outward, Can the normal direction point to the inside or the outside be judged from the definition of the cylindrical surface?? In other words, what is the difference between the definitions of A and B?

Wed, 05/11/2022 - 12:21

If the coordinate system is left-handed then normal is inward.

Thu, 05/12/2022 - 03:15

Thank you very much, Mikhail. You solved a problem that was confusing me.