Hi Sander,

Good to have you on-board, welcome to the PythonOCC list.

def test (event=None):
>     pole_number = 3
>     poles3d     = TColgp.TColgp_Array1OfPnt(1, pole_number)
>     poles3d2     = TColgp.TColgp_Array1OfPnt(1, pole_number)
>     poles3d.SetValue(1 , gp.gp_Pnt(0,0,0))
>     poles3d.SetValue(2 , gp.gp_Pnt(0,1,0))
>     poles3d.SetValue(3 , gp.gp_Pnt(0,1,1))
>
>     acrv=Geom.Geom_BezierCurve(poles3d)
>
>     poles3d2.SetValue(1 , gp.gp_Pnt(1,0,0))
>     poles3d2.SetValue(2 , gp.gp_Pnt(1,1,0))
>     poles3d2.SetValue(3 , gp.gp_Pnt(1,1,1))
>
>     bcrv=Geom.Geom_BezierCurve(poles3d2)
>     srf=GeomFill.GeomFill_Surface(acrv.GetHandle(),bcrv.GetHandle())
>
>     display.DisplayColoredShape(srf , 'YELLOW' )
>

Display(Colored)Shape takes an TopoDS_Shape subclass as an instance.
Actually, this is quite interesting; in CAD you need to distinct between a
topological and a geometrical entity.
You've created a geometrical entity, now you need to make a topological
enitity from your surface, in CAD parlance, you need to build a Face from a
surface.
I suggest the OCC.Utils.Construct.make_face function [1] to do so.

So, the last few lines would like:

    srf=GeomFill.GeomFill_Surface(acrv.GetHandle(),bcrv.GetHandle())
>     face = make_face(srf)
>     display.DisplayColoredShape(face , 'YELLOW' )
>

I think you've got an interesting project on your hands.
Can I suggest you to check out the geometry [2] examples?
That might prove to be insightful for you.

Alright, cheers,

-jelle

[1]
https://github.com/tpaviot/pythonocc/blob/master/src/addons/Utils/Construct.py#L139
[2] https://github.com/tpaviot/pythonocc/tree/master/src/examples/Geometry
_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to