Hi Everyone
I’m new at this Brep stuff. I have one question. Using Rhino SDK I’m trying to create new Brep, I have surface (let’s say plane) and closed curve on it. I want new Brep with the same face as the surface and closed curve as edge (Like cutting up from the surface). Please explain to me the procedure of this.
I do the following:
brep->m_S.Append(const_cast<ON_Surface*> (srf)); // adding pointer to the surface
brep->m_C3.Append(const_cast<ON_Curve*> (crv)); // adding pointer to the curve
ON_BrepVertex& v = brep->NewVertex(crv->PointAtStart()); // adding vertex
// get the index of the surface that will be added
int si = brep->m_S.Count();
// add the surface
brep->m_S.Append(const_cast(srf));
// create a face with the surface index
ON_BrepFace face = brep->NewFace(si);
on the created BREP to get some information on why the BREP was not valid.
The order in which I do trim creation is:
Create the vertices - returns vertex indices
Create the 3D curves - returns c3 indices
Create the edges - return edge indices
Create the face - returns face
Create the loop - outer or inner loop depending on trim orientation
Create a trim on each edge:
*create the 2D curves - return c2 indices
determine the iso-type (in your case this is not_iso in all cases
create the trim using edge, loop and c2-index
*
In the case of a plane with a closed trimming curve, use ON_BrepTrimmedPlane. See opennurbs_brep.h for details. If you want to know what this function does “under the hood”, download the openNURBS source code from here:
Thank you menno, I use already textlog and helped me a lot. I will try again with this order and I give the best…
PS: Where I can find some examples of building the brep?