Change disk to hemisphere

Technical discussions
Post Reply
Stefan Prymula
Posts: 2
Joined: Tue Oct 27, 2020 3:04 am

Change disk to hemisphere

Post by Stefan Prymula »

Hi
I need to convert a disk, which is circular face as IBRepFace_DG to a hemisphere. So the main thing is how to obtain the center and radius of the face, which can come from somewhere else and I do not know in advance, It has to be a generic function.
Thanks

Peter_j19
Posts: 3
Joined: Wed Jun 26, 2019 10:02 am

Re: Change disk to hemisphere

Post by Peter_j19 »

If you know the face is a disk you can get the parameters from any its edge:
Take any three points on the edge and build a circle on it.

Little more detail:

The points can be obtained as IBRepEdge_DG.GetPointRatio(0.0);IBRepEdge_DG.GetPointRatio(0.5); IBRepEdge_DG.GetPointRatio(1.0)

Construct a circle like

Code: Select all

IObjectGenerator_DG.Create("Circle_DG") as ICircle_DG
Call ICircle_DG.Init2(pt0, pt1, pt2); to define the circle.

Use ICircle_DG.GetCenter(), ICircle_DG.GetRadius(), ICircle_DG.GetAxisDirection() to get the parameters you need.

Peter

Stefan Prymula
Posts: 2
Joined: Tue Oct 27, 2020 3:04 am

Re: Change disk to hemisphere

Post by Stefan Prymula »

Nice. Thank you Peter

Post Reply