Hi Nathan!

Welcome to PythonOCC, we're very pleased you seem to like it!

Regarding the concatenation issue of beziers -> splines, here's how I do it:


where __inner is a list of Geom_Curve instances

        comp_curve = GeomConvert_CompCurveToBSplineCurve(__inner[0])
        for i in __inner[1:]:
            comp_curve.Add(i, TOLERANCE, False)

Cheers!

-jelle



On Jul 9, 2009, at 9:03 AM, Thomas Paviot wrote:



2009/7/8 Nathan Lauener <lauener.nat...@gmx.ch>
Hi,

I'm pretty new to pythonocc and am impressed by it. Thanks for your work!

After I ran across splines the other day I am now trying to use

opencascade and pythonocc for curve definitions and anaylsis. But I
could not figure out how to concat two splines into one. The mailing
list and searching the internet only showed examples on how to do it in
C++, and I can not adopt it to python! The function I'd like to use is
GeomConvert().ConcatG1(), but I can't figure out how to declare the
third parameter of type Handle_TColGeom_HArray1OfBSplineCurve. I always
get a constructor or type error. See the listing of my little sample
programm.

   #Line
   L2 = GC_MakeSegment(L1.Lin(),0,8)
   L3 = Geom_TrimmedCurve(L1.GetHandle(),0,8)
   L3_S =
GeomConvert ().CurveToBSplineCurve(L3.GetHandle(),Convert.Convert_TgtThetaOver2
)

   #Circle
   P2 = gp_Pnt(2,8,0)
   N = gp_Dir(0,0,-1)
   C1 = Geom_Circle(gp.gp_Ax2(P2,N),2)
   C3 = Geom_TrimmedCurve(C1.GetHandle(),0,math.pi/2)
   C3_S =
GeomConvert ().CurveToBSplineCurve(C3.GetHandle(),Convert.Convert_TgtThetaOver2
)

   #concat
   curves = TColGeom_Array1OfBSplineCurve(0,1)
   curves.SetValue(0,L3_S)
   curves.SetValue(1,C3_S)
   print curves.Length()
   tol = TColStd_Array1OfReal(0,0)
   tol.SetValue(0,0.0)

   newCurve = Handle_TColGeom_HArray1OfBSplineCurve()
   GeomConvert().ConcatG1(curves, tol, newCurve, False, 0.0)

Regards,
Nathan

Hi Nathan,

I don't see any error in your code. Can you provide the traceback and/or a sample script so that we can help you to figure out what's wrong?

Regards,

Thomas

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to