42 namespace NekMeshUtils
46 "oce", CADCurveOCE::create,
"CADCurveOCE");
51 (m_occCurve.LastParameter() - m_occCurve.FirstParameter()) / (1000);
52 NekDouble t = m_occCurve.FirstParameter();
61 m_occCurve.D1(t, P1, drdt1);
63 m_occCurve.D1(t, P2, drdt2);
65 len += (drdt1.Magnitude() + drdt2.Magnitude()) / 2.0 * dt;
74 Handle(Geom_Curve) NewCurve =
new Geom_TrimmedCurve(m_c, ti, tf);
75 TopoDS_Edge NewEdge = BRepBuilderAPI_MakeEdge(NewCurve);
77 BRepGProp::LinearProperties(NewEdge, System);
78 return System.Mass() / 1000.0;
86 gp_Pnt loc(xyz[0]*1000.0, xyz[1]*1000.0, xyz[2]*1000.0);
88 ShapeAnalysis_Curve sac;
90 sac.Project(m_c,loc,1e-8 ,p,t);
92 if(p.Distance(loc) > 1e-5)
94 cerr <<
"large loct distance" << endl;
102 gp_Pnt loc = m_occCurve.Value(t);
104 location[0] = loc.X();
105 location[1] = loc.Y();
106 location[2] = loc.Z();
116 m_occCurve.D2(t, loc, d1, d2);
134 pair<CADSurfSharedPtr, CADOrientation::Orientation> surface;
135 ASSERTL0(m_adjSurfs.size() == 1,
"This will only work in 2D for one surface at the moment");
136 surface = m_adjSurfs[0];
156 N[0] = (d1[3] * du + d1[6] * dv) / 2.0;
157 N[1] = (d1[4] * du + d1[7] * dv) / 2.0;
158 N[2] = (d1[5] * du + d1[8] * dv) / 2.0;
160 NekDouble mag = sqrt(N[0]*N[0] + N[1]*N[1] + N[2]*N[2]);
170 GeomLProp_CLProps d(m_c,2,1e-8);
171 d.SetParameter(t+1e-8);
174 if(d2.Magnitude() < 1e-8)
193 GeomLProp_CLProps d(m_c,2,1e-8);
196 return d.Curvature() * 1000.0;
202 t[0] = m_occCurve.FirstParameter();
203 t[1] = m_occCurve.LastParameter();
213 BRep_Tool::Pnt(TopExp::FirstVertex(m_occEdge, Standard_True));
214 gp_Pnt end = BRep_Tool::Pnt(TopExp::LastVertex(m_occEdge, Standard_True));
CADCurveFactory & GetCADCurveFactory()
#define ASSERTL0(condition, msg)
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.