Hello
I need to build a face from a circle. My few attempts have ended in exceptions.
What is the right way to build this?
Thanks in advance.
Building a face from a circle
-
Mike Zubovic
- Posts: 54
- Joined: Mon Jul 15, 2024 5:20 am
Re: Building a face from a circle
There are many ways for doing this.
The minimum code way is using IStdShape_DG.Disk(). It will create a disk in the xy palne, which can be moved around.
I have hacked PatchForm_Load() of the installed C# Patch sample to check:
It works.
The minimum code way is using IStdShape_DG.Disk(). It will create a disk in the xy palne, which can be moved around.
I have hacked PatchForm_Load() of the installed C# Patch sample to check:
Code: Select all
//Before m_iEntity = iStdShape.Cylinder(m_baseRadius, m_topRadius, m_height);
m_iEntity = iStdShape.Disk(0, m_baseRadius);
// Set locationg and orientation
IFrame_DG iFrame = m_iEntity.GetLocation();
iFrame.SetOrigin(0, 0.5* m_baseRadius, 0);
iFrame.Rotate(0.25 * Math.PI, 1); // Rotate around Y axis
-
Mike Zubovic
- Posts: 54
- Joined: Mon Jul 15, 2024 5:20 am
Re: Building a face from a circle
Another way is via IBRepBuilder_DG. Search samples for IBRepBuilder_DG to find a way to get it.
IBRepEdge_DG IBRepBuilder_DG.CreateEdge4(ICircle_DG circle) >
IBRepWire_DG IBRepBuilder_DG.CreateWire() >
IBRepWire_DG.AddEdge(IBRepEdge_DG edge)
IBRepFace_DG IBRepBuilder_DG.CreateFace7(IBRepWire_DG wire)
IBRepEdge_DG IBRepBuilder_DG.CreateEdge4(ICircle_DG circle) >
IBRepWire_DG IBRepBuilder_DG.CreateWire() >
IBRepWire_DG.AddEdge(IBRepEdge_DG edge)
IBRepFace_DG IBRepBuilder_DG.CreateFace7(IBRepWire_DG wire)