def curve(self): """ :return: The underlying curve of the edge. :rtype: afem.geometry.entities.Curve """ geom_curve, _, _ = BRep_Tool.Curve_(self.object, 0., 0.) return Curve.wrap(geom_curve)
def __init__(self, crv, pln, direction=None, keep_param=True): super(ProjectCurveToPlane, self).__init__() direction = CheckGeom.to_direction(direction) if not CheckGeom.is_direction(direction): direction = pln.object.Pln().Axis().Direction() # OCC projection hcrv = GeomProjLib.ProjectOnPlane_(crv.object, pln.object, direction, keep_param) self._crv = Curve(hcrv)
def __init__(self, srf1, srf2, itol=1.0e-7, approx=True): super(IntersectSurfaceSurface, self).__init__() # OCC intersect ssi = GeomInt_IntSS(srf1.object, srf2.object, itol, approx, False, False) # Build curves ncrvs = ssi.NbLines() crvs = [] for i in range(1, ncrvs + 1): hcrv = ssi.Line(i) crvs.append(Curve(hcrv)) self._crvs = crvs self._tol3d = ssi.TolReached3d()
def curve(self): """ :return: The curve formed by concatenating all the underlying curves of the edges. :rtype: afem.geometry.entities.NurbsCurve """ geom_convert = GeomConvert_CompCurveToBSplineCurve() exp = BRepTools_WireExplorer(self.object) tol = self.tol_max while exp.More(): e = TopoDS.Edge_(exp.Current()) exp.Next() adp_crv = BRepAdaptor_Curve(e) geom_convert.Add(adp_crv.BSpline(), tol) geom_curve = geom_convert.BSplineCurve() return Curve.wrap(geom_curve)
def __init__(self, crv, srf): super(ProjectCurveToSurface, self).__init__() # OCC projection hcrv = GeomProjLib.Project_(crv.object, srf.object) self._crv = Curve(hcrv)