Hi @dale ,
I am facing an issue in creating Brep via api, in order track down the issue, i just tried reading the brep data using plugin, and tried to recreate it via API. but still facing issue in creating an innerLoop.
you could see from the above image the inner loop has surface and it trimmed improperly.
checked the datas like ,
making the inner edges /curve3d in clockwise
making the outer edges/curve3d in anticlockwise.
creating trims for both outer and inner loops.
even
the log couldn’t give any error message, it says its an valid brep.
can you help o this.
thanks
VJ
menno
(Menno Deij - van Rijswijk)
July 2, 2024, 5:42pm
2
There are some examples for this. See
C++
/////////////////////////////////////////////////////////////////////////////
// cmdSampleFaceWithHole.cpp : command file
//
#include "stdafx.h"
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
//
// BEGIN SampleFaceWithHole command
//
// symbolic vertex index constants to make code more readable
static const int
A = 0,
B = 1,
C = 2,
D = 3,
E = 4,
F = 5,
This file has been truncated. show original
and in C#:
using Rhino;
using Rhino.Commands;
using Rhino.Geometry;
namespace SampleCsCommands
{
public class SampleCsFaceWithHole : Command
{
public override string EnglishName => "SampleCsFaceWithHole";
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
var brep = MakeBrepFace();
if (null == brep)
return Result.Failure;
doc.Objects.AddBrep(brep);
doc.Views.Redraw();
return Result.Success;
This file has been truncated. show original
@menno , thanks for your response and help.
I have resolved this by calling Brep.Repair(0.1,0.1) and its heals the brep I guess.
1 Like