Page 1 of 1

Building a face from a circle

Posted: Wed Jan 14, 2026 2:51 am
by Stu Abinavski
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.

Re: Building a face from a circle

Posted: Thu Jan 15, 2026 12:38 am
by Mike Zubovic
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:

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
It works.

Re: Building a face from a circle

Posted: Fri Jan 16, 2026 1:51 am
by Mike Zubovic
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)