本文整理汇总了C++中ON_Brep::AddSurface方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_Brep::AddSurface方法的具体用法?C++ ON_Brep::AddSurface怎么用?C++ ON_Brep::AddSurface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_Brep
的用法示例。
在下文中一共展示了ON_Brep::AddSurface方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ON_Brep_CopyTrims
RH_C_FUNCTION ON_Brep* ON_Brep_CopyTrims( const ON_BrepFace* pConstBrepFace, const ON_Surface* pConstSurface, double tolerance)
{
ON_Brep* rc = NULL;
if( pConstBrepFace && pConstSurface )
{
ON_Brep* brep = pConstBrepFace->Brep();
int fi = pConstBrepFace->m_face_index;
ON_Brep* brp = brep->DuplicateFace(fi, FALSE);
ON_Surface* srf = pConstSurface->DuplicateSurface();
int si = brp->AddSurface(srf);
brp->m_F[0].ChangeSurface(si);
if (brp->RebuildEdges(brp->m_F[0], tolerance, TRUE, TRUE))
{ brp->Compact(); }
else
{ delete brp; }
rc = brp;
}
return rc;
}
示例2: ON_BrepExtrudeHelper_MakeCap
static
bool ON_BrepExtrudeHelper_MakeCap(
ON_Brep& brep,
int bottom_loop_index,
const ON_3dVector path_vector,
const int* side_face_index
)
{
bool bCap = true;
// make cap
if ( !ON_BrepExtrudeHelper_CheckLoop( brep, bottom_loop_index ) )
return false;
brep.m_F.Reserve(brep.m_F.Count() + 1);
brep.m_L.Reserve(brep.m_L.Count() + 1);
const ON_BrepLoop& bottom_loop = brep.m_L[bottom_loop_index];
const ON_BrepFace& bottom_face = brep.m_F[bottom_loop.m_fi];
const ON_Surface* bottom_surface = bottom_face.SurfaceOf();
ON_Surface* top_surface = bottom_surface->Duplicate();
top_surface->Translate( path_vector );
int top_surface_index = brep.AddSurface( top_surface );
ON_BrepFace& top_face = brep.NewFace( top_surface_index );
bCap = ON_BrepExtrudeHelper_MakeTopLoop( brep, top_face, bottom_loop_index, path_vector, side_face_index );
if ( bCap )
{
ON_BrepLoop& top_loop = brep.m_L[brep.m_L.Count()-1];
if ( bottom_loop.m_type == ON_BrepLoop::inner )
{
// we capped an inner boundary
// top_loop.m_type = ON_BrepLoop::outer; // done in ON_BrepExtrudeHelper_MakeTopLoop
brep.FlipLoop(top_loop);
}
else if ( bottom_loop.m_type == ON_BrepLoop::outer )
{
// we capped an outer boundary
// top_loop.m_type = ON_BrepLoop::outer; // done in ON_BrepExtrudeHelper_MakeTopLoop
brep.FlipFace(top_face);
}
}
else
{
// delete partially made cap face
brep.DeleteFace( top_face, false );
delete brep.m_S[top_surface_index];
brep.m_S[top_surface_index] = 0;
}
return bCap;
}
示例3: ON_BrepExtrude
//.........这里部分代码省略.........
{
ON_BrepVertex& topv = brep.m_V[topvimap[vi]];
ON_Curve* c3 = path_curve.DuplicateCurve();
if ( !c3 )
{
bOK = false;
}
else
{
ON_3dVector D = bottomv.point - PathStart;
c3->Translate(D);
int c3i = brep.AddEdgeCurve(c3);
const ON_BrepEdge& e = brep.NewEdge(bottomv,topv,c3i,0,0.0);
sideveimap[vi] = e.m_edge_index;
}
break;
}
}
}
if ( bOK && bCap )
{
// build top faces
for (fi = 0; fi < fcount0; fi++ )
{
const ON_BrepFace& bottomf = brep.m_F[fi];
ON_Surface* srf = bottomf.DuplicateSurface();
if ( !srf )
{
bOK = false;
break;
}
srf->Transform(tr);
int si = brep.AddSurface(srf);
ON_BrepFace& topf = brep.NewFace(si);
topf.m_bRev = !bottomf.m_bRev;
const int loop_count = bottomf.m_li.Count();
topf.m_li.Reserve(loop_count);
for ( int fli = 0; fli < loop_count; fli++ )
{
const ON_BrepLoop& bottoml = brep.m_L[bottomf.m_li[fli]];
ON_BrepLoop& topl = brep.NewLoop(bottoml.m_type,topf);
const int loop_trim_count = bottoml.m_ti.Count();
topl.m_ti.Reserve(loop_trim_count);
for ( int lti = 0; lti < loop_trim_count; lti++ )
{
const ON_BrepTrim& bottomt = brep.m_T[bottoml.m_ti[lti]];
ON_NurbsCurve* c2 = ON_NurbsCurve::New();
if ( !bottomt.GetNurbForm(*c2) )
{
delete c2;
bOK = false;
break;
}
int c2i = brep.AddTrimCurve(c2);
ON_BrepTrim* topt = 0;
if ( bottomt.m_ei >= 0 )
{
ON_BrepEdge& tope = brep.m_E[topeimap[bottomt.m_ei]];
topt = &brep.NewTrim(tope,bottomt.m_bRev3d,topl,c2i);
}
else
{
// singular trim
ON_BrepVertex& topv = brep.m_V[topvimap[bottomt.m_vi[0]]];
topt = &brep.NewSingularTrim(topv,topl,bottomt.m_iso,c2i);