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

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

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

Samples & Tools

 

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

Adv. Components

Related pages

axis of a hole?

Vicart's picture
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
// ???

Any advice is appreciated!

Best Regards!
Vicart!

Sharjith Naramparambath's picture

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

Sharjith Naramparambath's picture

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

Vicart's picture

Thanks your advice!

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!

Sharjith Naramparambath's picture

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

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.