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
Change disk to hemisphere
Re: Change disk to hemisphere
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
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
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
Use ICircle_DG.GetCenter(), ICircle_DG.GetRadius(), ICircle_DG.GetAxisDirection() to get the parameters you need.
Peter
-
- Posts: 2
- Joined: Tue Oct 27, 2020 3:04 am
Re: Change disk to hemisphere
Nice. Thank you Peter