For all issues regarding the Forums use, please, refer to the Forum Rules.

### Our Solutions

Need professional assistance?
Consider our:

Need to speed up your development?
Have a look at our:

Need some functionality extending standard OCCT capabilities?
Check out our:

# axis of a hole?

Forums:

Help!
Current selection mode is TopAbs_FACE.
I select a hole surface on a shape.
Can I get the hole's main axis?
-------------------
Handle(Geom_Surface) aSelectedGeometricSurface = ...
// how to get the main axis
// ???

Best Regards!
Vicart!

### axis of a

I think you want to create hole on the surface selected is it? Well if that is the case the suggestion is that when you select the face, also get the clicked mouse coordinates and convert it into point in the 3d space. This can be done by Stephane's ConvertClickToPoint() function perfectly. You get the point and project on the surface of the face selected.
then create the axis perpendicular to the face passing thru the obtained point. Just try. Best Luck!

N. Sharjith

### axis of a

Hi,
Well if you are selecting a face already having a hole on it and want to recover the axis of the hole, then get the edge of the hole on the face, convert it into curve, downcast to circle, get center point of the circle, get plane of the selected face, create axis perpendicular to plane passing thru center point obtained. Plz forgive if idea sounds foolish.

N. Sharjith

### axis of a

I cut down the operation into two steps.
First,I get the mass center of the cylinder surface ( a hole in a solid),then move the mass point to the related surface of the solid.It seems to work well.
I'll have a try to iterate all the edges of the hole's cylinder surface.If the edge is a circle,then I can get the center.I wonder how to distinguish the two parallel circles.It seems to be a good idea that a edge selection mode is actived!

### axis of a

Hi,
One doubt, if you can get the cylinderical surface, can you not get its axis directly?