From 6a75f2c8706616033e6ab85345d310101eff8be1 Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 14 Dec 2012 12:54:25 +0000 Subject: [PATCH] Mantis issue 0021865: Adding tangency in Spline creation --- doc/salome/gui/GEOM/input/creating_curve.doc | 4 ++-- .../gui/GEOM/input/tui_basic_geom_objs.doc | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/salome/gui/GEOM/input/creating_curve.doc b/doc/salome/gui/GEOM/input/creating_curve.doc index e70a6279c..29cbbc8d1 100644 --- a/doc/salome/gui/GEOM/input/creating_curve.doc +++ b/doc/salome/gui/GEOM/input/creating_curve.doc @@ -77,8 +77,8 @@ if two above check boxes are not checked. \n TUI Command: -geompy.MakeInterpol(ListOfShapes,isClosed,doReordering) -geompy.MakeInterpolWithTangents(ListOfShapes,Vector1,Vector2) +
geompy.MakeInterpol(ListOfShapes,isClosed,doReordering) +
geompy.MakeInterpolWithTangents(ListOfShapes,Vector1,Vector2) Analytical Definition diff --git a/doc/salome/gui/GEOM/input/tui_basic_geom_objs.doc b/doc/salome/gui/GEOM/input/tui_basic_geom_objs.doc index 7f230b142..e9b6bd63d 100644 --- a/doc/salome/gui/GEOM/input/tui_basic_geom_objs.doc +++ b/doc/salome/gui/GEOM/input/tui_basic_geom_objs.doc @@ -215,13 +215,16 @@ import geompy import salome gg = salome.ImportComponentGUI("GEOM") -# create vertices +# create vertices and vectors p0 = geompy.MakeVertex(0. , 0. , 0. ) p1 = geompy.MakeVertex(50. , 100., 200.) p2 = geompy.MakeVertex(150., 50., 100.) p3 = geompy.MakeVertex(100., 150., 170.) p4 = geompy.MakeVertex(200., 200., 150.) +v1 = geompy.MakeVectorDXDYDZ(0, 1, 0) +v2 = geompy.MakeVectorDXDYDZ(1, 0, 0) + # create a polyline from a list of points polyline = geompy.MakePolyline([p0, p1, p2, p3, p4]) @@ -231,32 +234,36 @@ bezier = geompy.MakeBezier([p0, p1, p2, p3, p4]) #create a b-spline curve from a list of points interpol = geompy.MakeInterpol([p0, p1, p2, p3, p4], False) +#create a b-spline curve with defined directions at the ends +interpol_tangents = geompy.MakeInterpolWithTangents([p0, p1, p2, p3, p4], v1, v2) + #create a polyline using parametric definition of the basic points param_polyline = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, geompy.GEOM.Polyline, theNewMethod=True) # create a bezier curve using parametric definition of the basic points -param_bezier = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, geompy.GEOM.Bezier, theNewMethod=True) +param_bezier = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 20, geompy.GEOM.Bezier, theNewMethod=True) #create a b-spline curve using parametric definition of the basic points param_interpol = geompy.MakeCurveParametric("t", "sin(t)", "cos(t)", 0., 100., 100, geompy.GEOM.Interpolation, theNewMethod=True) - # add objects in the study id_p0 = geompy.addToStudy(p0, "Point1") id_p1 = geompy.addToStudy(p1, "Point2") id_p2 = geompy.addToStudy(p2, "Point3") id_p3 = geompy.addToStudy(p3, "Point4") id_p4 = geompy.addToStudy(p4, "Point5") +id_v1 = geompy.addToStudy(v1, "Vector1") +id_v2 = geompy.addToStudy(v2, "Vector2") id_polyline = geompy.addToStudy(polyline, "Polyline") id_bezier = geompy.addToStudy(bezier, "Bezier") id_interpol = geompy.addToStudy(interpol, "Interpol") +id_interpol_tangents = geompy.addToStudy(interpol_tangents, "Interpol Tangents") id_param_polyline = geompy.addToStudy(param_polyline, "Polyline Parametric") id_param_bezier = geompy.addToStudy(param_bezier, "Bezier Parametric") id_param_interpol = geompy.addToStudy(param_interpol, "Interpol Parametric") - # display the points and the curves gg.createAndDisplayGO(id_p0) gg.createAndDisplayGO(id_p1) @@ -266,6 +273,7 @@ gg.createAndDisplayGO(id_p4) gg.createAndDisplayGO(id_polyline) gg.createAndDisplayGO(id_bezier) gg.createAndDisplayGO(id_interpol) +gg.createAndDisplayGO(id_interpol_tangents) gg.createAndDisplayGO(id_param_polyline) gg.createAndDisplayGO(id_param_bezier) gg.createAndDisplayGO(id_param_interpol) -- 2.39.2