本文整理汇总了C++中ON_Curve::PointAtStart方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_Curve::PointAtStart方法的具体用法?C++ ON_Curve::PointAtStart怎么用?C++ ON_Curve::PointAtStart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_Curve
的用法示例。
在下文中一共展示了ON_Curve::PointAtStart方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ON_BrepExtrudeHelper_CheckPathCurve
static
bool ON_BrepExtrudeHelper_CheckPathCurve( const ON_Curve& path_curve, ON_3dVector& path_vector )
{
ON_Line path_line;
path_line.from = path_curve.PointAtStart();
path_line.to = path_curve.PointAtEnd();
path_vector = path_line.Direction();
return ( path_vector.IsZero() ? false : true );
}
示例2: textlog
static void
test_pci(ON_3dPoint &p, ON_Curve &c)
{
ON_wString wstr;
ON_TextLog textlog(wstr);
ON_ClassArray<ON_PX_EVENT> x;
// Use default tolerance
ON_Intersect(p, c, x);
ON_3dPoint start = c.PointAtStart();
ON_3dPoint end = c.PointAtEnd();
bu_log("(%f,%f,%f) and [(%f,%f,%f) to (%f,%f,%f)]:\n",
p[0], p[1], p[2], start[0], start[1], start[2], end[0], end[1], end[2]);
if (x.Count() == 0) {
bu_log("No intersection.\n");
} else {
for (int i = 0; i < x.Count(); i++)
x[i].Dump(textlog);
ON_String str(wstr);
bu_log(str.Array());
}
bu_log("\n\n");
}
示例3: ON_BrepExtrude
bool ON_BrepExtrude(
ON_Brep& brep,
const ON_Curve& path_curve,
bool bCap
)
{
ON_Workspace ws;
const int vcount0 = brep.m_V.Count();
const int tcount0 = brep.m_T.Count();
const int lcount0 = brep.m_L.Count();
const int ecount0 = brep.m_E.Count();
const int fcount0 = brep.m_F.Count();
const ON_3dPoint PathStart = path_curve.PointAtStart();
ON_3dPoint P = path_curve.PointAtEnd();
if ( !PathStart.IsValid() || !P.IsValid() )
return false;
const ON_3dVector height = P - PathStart;
if ( !height.IsValid() || height.Length() <= ON_ZERO_TOLERANCE )
return false;
ON_Xform tr;
tr.Translation(height);
// count number of new sides
int side_count = 0;
int i, vi, ei, fi;
bool* bSideEdge = (bool*)ws.GetIntMemory(ecount0*sizeof(bSideEdge[0]));
for ( ei = 0; ei < ecount0; ei++ )
{
const ON_BrepEdge& e = brep.m_E[ei];
if ( 1 == e.m_ti.Count() )
{
side_count++;
bSideEdge[ei] = true;
}
else
{
bSideEdge[ei] = false;
}
}
brep.m_V.Reserve( 2*vcount0 );
i = 4*side_count + (bCap?tcount0:0);
brep.m_T.Reserve( tcount0 + i );
brep.m_C2.Reserve( brep.m_C2.Count() + i );
brep.m_L.Reserve( lcount0 + side_count + (bCap?lcount0:0) );
i = side_count + (bCap?ecount0:side_count);
brep.m_E.Reserve( ecount0 + i );
brep.m_C3.Reserve( brep.m_C3.Count() + i );
i = side_count + (bCap?fcount0:0);
brep.m_F.Reserve( fcount0 + i );
brep.m_S.Reserve( brep.m_S.Count() + i );
bool bOK = true;
// build top vertices
int* topvimap = ws.GetIntMemory(vcount0);
memset(topvimap,0,vcount0*sizeof(topvimap[0]));
if ( bCap )
{
for ( vi = 0; vi < vcount0; vi++ )
{
const ON_BrepVertex& bottomv = brep.m_V[vi];
ON_BrepVertex& topv = brep.NewVertex(bottomv.point+height,bottomv.m_tolerance);
topvimap[vi] = topv.m_vertex_index;
}
}
else
{
for ( ei = 0; ei < ecount0; ei++ )
{
if ( bSideEdge[ei] )
{
const ON_BrepEdge& bottome = brep.m_E[ei];
int bottomvi0 = bottome.m_vi[0];
if ( bottomvi0 < 0 || bottomvi0 >= vcount0 )
{
bOK = false;
break;
}
int bottomvi1 = bottome.m_vi[1];
if ( bottomvi1 < 0 || bottomvi1 >= vcount0 )
{
bOK = false;
break;
}
if ( !topvimap[bottomvi0] )
{
const ON_BrepVertex& bottomv = brep.m_V[bottomvi0];
ON_BrepVertex& topv = brep.NewVertex(bottomv.point+height,bottomv.m_tolerance);
topvimap[bottomvi0] = topv.m_vertex_index;
}
if ( !topvimap[bottomvi1] )
{
const ON_BrepVertex& bottomv = brep.m_V[bottomvi1];
ON_BrepVertex& topv = brep.NewVertex(bottomv.point+height,bottomv.m_tolerance);
topvimap[bottomvi1] = topv.m_vertex_index;
}
}
//.........这里部分代码省略.........