Hi everyone,

I'm relatively new to pythonOCC and I'm having a bit of a problem with my code. 
It's really quite basic. I created a cylinder and extracted an edge, which I 
made into a wire and a face, which in theory should not be a problem. 
Unfortunately the face does not show up in the display window (see the code 
below). I've tried the doxygen documentation, but didn't find anything helpful. 
Is there any way to make a face from extracted edges? Thank you very much for 
your help in advance.

Regards,
Balint



import OCC.TopoDS
from OCC.Utils.Topology import Topo
from OCC.TopTools import *
import math

from OCC.Display.SimpleGui import *
display, start_display, add_menu, add_function_to_menu = init_display()

shroudRadius = 3.0
hubRadius = 1.0
radius = 0.2
epsilon = 1.0e-1

## Creating circle and making cylinder:
centerCircle = OCC.gp.gp_Pnt(hubRadius-epsilon, 0, 0.5)
myAX2 = OCC.gp.gp_Ax2(centerCircle,OCC.gp.gp_Dir(1, 0, 0))
circle = OCC.gp.gp_Circ(myAX2, radius)

Edge2 = OCC.BRepBuilderAPI.BRepBuilderAPI_MakeEdge(circle, 0, 
2.0*math.pi).Edge()
ExistingWire = OCC.BRepBuilderAPI.BRepBuilderAPI_MakeWire(Edge2).Wire()
PrismFace = OCC.BRepBuilderAPI.BRepBuilderAPI_MakeFace(ExistingWire).Shape()

length = OCC.gp.gp_Vec(shroudRadius-hubRadius+2.0*epsilon, 0, 0)

bladeSurface = OCC.BRepPrimAPI.BRepPrimAPI_MakePrism(PrismFace, length).Shape()
bladeSurface = OCC.BRepPrimAPI.BRepPrimAPI_MakePrism(ExistingWire, 
length).Shape()
#display.DisplayShape(bladeSurface)
topoBlade = OCC.Utils.Topology.Topo(bladeSurface)
topoBlade.number_of_shells()
bladeFace = topoBlade.faces().next()

## Getting the desired edge:
edges = []
for edge in topoBlade.edges_from_face(bladeFace):
        edge.Reverse()
        edges.append(edge)

## Creating wire and face
edgeWire = OCC.BRepBuilderAPI.BRepBuilderAPI_MakeWire(edges[1]).Wire()
edgeFace = OCC.BRepBuilderAPI.BRepBuilderAPI_MakeFace(edgeWire).Shape()
display.DisplayShape(edgeFace)
start_display()
-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl

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

Reply via email to