[brlcad-commits] SF.net SVN: brlcad:[50887] brlcad/trunk/src/librt/primitives/pipe/pipe_brep .cpp
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <pho...@us...> - 2012-06-05 12:18:50
|
Revision: 50887 http://brlcad.svn.sourceforge.net/brlcad/?rev=50887&view=rev Author: phoenixyjll Date: 2012-06-05 12:18:40 +0000 (Tue, 05 Jun 2012) Log Message: ----------- There used to be bugs with the colinear parts. Modified Paths: -------------- brlcad/trunk/src/librt/primitives/pipe/pipe_brep.cpp Modified: brlcad/trunk/src/librt/primitives/pipe/pipe_brep.cpp =================================================================== --- brlcad/trunk/src/librt/primitives/pipe/pipe_brep.cpp 2012-06-05 11:18:43 UTC (rev 50886) +++ brlcad/trunk/src/librt/primitives/pipe/pipe_brep.cpp 2012-06-05 12:18:40 UTC (rev 50887) @@ -85,14 +85,14 @@ ON_BrepEdge& startinneredge = (*b)->NewEdge((*b)->m_V[vert3ind], (*b)->m_V[vert3ind], c3ind); startinneredge.m_tolerance = 0.0; ON_BrepEdge& endinneredge = (*b)->NewEdge((*b)->m_V[vert4ind], (*b)->m_V[vert4ind], c4ind); - endinneredge.m_tolerance = 0.0; - startinnercurves->Empty(); - for (int i = 0; i < endinnercurves->Count(); i++) { - ON_Curve *curve = (*endinnercurves)[i]; - startinnercurves->Append(curve); - } + endinneredge.m_tolerance = 0.0; (*b)->NewRuledFace(startinneredge, false, endinneredge, false); } + startinnercurves->Empty(); + for (int i = 0; i < endinnercurves->Count(); i++) { + ON_Curve *curve = (*endinnercurves)[i]; + startinnercurves->Append(curve); + } } @@ -169,7 +169,7 @@ nextp = BU_LIST_NEXT(wdb_pipept, &curp->l); if (BU_LIST_IS_HEAD(&curp->l, &pip->pipe_segs_head)) return; - VMOVE(current_point, prevp->pp_coord); + VMOVE(current_point, curp->pp_coord); VSUB2(pipe_dir, prevp->pp_coord, curp->pp_coord); bn_vec_ortho(x_dir, pipe_dir); @@ -249,11 +249,11 @@ if (isnan(dist_to_bend) || VNEAR_ZERO(norm, SQRT_SMALL_FASTF) || NEAR_ZERO(dist_to_bend, SQRT_SMALL_FASTF)) { // points are colinear, treat as linear segment - VSUB2(pipe_dir, prevp->pp_coord, current_point); + VSUB2(pipe_dir, current_point, curp->pp_coord); bn_vec_ortho(x_dir, pipe_dir); VCROSS(y_dir, pipe_dir, x_dir); VUNITIZE(y_dir); - plane_origin = ON_3dPoint(current_point); + plane_origin = ON_3dPoint(curp->pp_coord); plane_x_dir = ON_3dVector(x_dir); plane_y_dir = ON_3dVector(y_dir); endplane = new ON_Plane(plane_origin, plane_x_dir, plane_y_dir); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |