52 BRepGProp::LinearProperties(
m_occEdge, System);
55 m_c = BRep_Tool::Curve(TopoDS::Edge(in),
m_b[0],
m_b[1]);
61 GeomAdaptor_Curve c(m_c);
63 return ap.Parameter();
68 Handle(Geom_Curve) NewCurve =
new Geom_TrimmedCurve(m_c, ti, tf);
69 TopoDS_Edge NewEdge = BRepBuilderAPI_MakeEdge(NewCurve);
71 BRepGProp::LinearProperties(NewEdge, System);
78 GeomAPI_ProjectPointOnCurve proj(loc, m_c,
m_b[0],
m_b[1]);
86 loc.Distance(m_c->Value(
m_b[1]))));
94 ShapeAnalysis_Curve sac;
96 sac.Project(m_c, loc, Precision::Confusion(), p, t);
110 ShapeAnalysis_Curve sac;
112 sac.Project(m_c, loc, Precision::Confusion(), p, t, cf, cl);
134 m_c->D2(t, loc, d1, d2);
140 return {l[0], l[1], l[2], a[0], a[1], a[2], b[0], b[1], b[2]};
145 GeomLProp_CLProps d(m_c, 2, Precision::Confusion());
146 d.SetParameter(t + 1e-8);
149 if (d2.Magnitude() < 1e-8)
152 return {0.0, 0.0, 0.0};
158 return {n.X(), n.Y(), n.Z()};
163 GeomLProp_CLProps d(m_c, 2, Precision::Confusion());
183 BRep_Tool::Pnt(TopExp::FirstVertex(
m_occEdge, Standard_True));
184 gp_Pnt end = BRep_Tool::Pnt(TopExp::LastVertex(
m_occEdge, Standard_True));
189 return {s0[0], s0[1], s0[2], s1[0], s1[1], s1[2]};
194 BRepMesh_IncrementalMesh brmsh(
m_occEdge, 0.005 * scale);
199 e =
min(e, 5e-3 * scale);
202 std::array<NekDouble, 6> ret;
203 B.Get(ret[0], ret[1], ret[2], ret[3], ret[4], ret[5]);
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
NekDouble m_length
Length of edge.
std::array< NekDouble, 2 > GetBounds() override
Returns the minimum and maximum parametric coords t of the curve.
std::array< NekDouble, 3 > P(NekDouble t) override
Gets the location (x,y,z) in an array out of the curve at point t.
NekDouble GetMinDistance(std::array< NekDouble, 3 > &xyz) override
Locates a point xyz in the parametric space. returns the distance to the point.
static CADCurveSharedPtr create()
std::array< NekDouble, 6 > BoundingBox(NekDouble scale) override
Returns the bounding box of a curve enlarged by 5e-3mm * scale.
std::array< NekDouble, 6 > GetMinMax() override
Gets the start and end of the curve.
void Initialise(int i, TopoDS_Shape in)
NekDouble loct(std::array< NekDouble, 3 > xyz, NekDouble &t) override
locates a point in the parametric space. returns the distance to the point and passes t by reference ...
std::array< NekDouble, 2 > m_b
store the parametric bounds of the curve
TopoDS_Edge m_occEdge
OpenCascade edge.
NekDouble Curvature(NekDouble t) override
Calculates the radius of curvature of the curve at point t.
std::array< NekDouble, 3 > N(NekDouble t) override
Returns the normal to a curve, it will always point in the concave direction.
std::array< NekDouble, 9 > D2(NekDouble t) override
Gets the second derivatives at t.
NekDouble tAtArcLength(NekDouble s) override
Calculates the parametric coordinate and arclength location defined by s.
Handle(Geom_Curve) m_c
object used for reverse lookups
NekDouble Length(NekDouble ti, NekDouble tf) override
Calculates the arclength between the two paremetric points ti and tf. ti must be less than tf.
gp_Pnt PntToCAD(const std::array< NekDouble, 3 > &p)
A point on its way into OpenCASCADE.
std::array< NekDouble, 3 > PntFromCAD(const gp_Pnt &p)
A point on its way out of OpenCASCADE.
std::array< NekDouble, 3 > VecFromCAD(const gp_Vec &v)
A vector on its way out of OpenCASCADE.
NekDouble CurvatureFromCAD(NekDouble curvature)
A curvature, one over a length, on its way out of OpenCASCADE.
NekDouble FromCAD(NekDouble length)
A length on its way out of OpenCASCADE.
NekDouble ToCAD(NekDouble length)
A length on its way into OpenCASCADE.
CADCurveFactory & GetCADCurveFactory()
scalarT< T > min(scalarT< T > lhs, scalarT< T > rhs)
scalarT< T > sqrt(scalarT< T > in)