From af0232ace0890ee6e8afc97c0fefd03a224c42bb Mon Sep 17 00:00:00 2001 From: deepa-chaudhari Date: Tue, 2 Jun 2015 22:34:08 +0530 Subject: Initial checkin --- utilities/__init__.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 utilities/__init__.py (limited to 'utilities') diff --git a/utilities/__init__.py b/utilities/__init__.py new file mode 100644 index 0000000..5498698 --- /dev/null +++ b/utilities/__init__.py @@ -0,0 +1,37 @@ +from OCC.AIS import AIS_Shape +from OCC.TopAbs import TopAbs_EDGE +from OCC.TopExp import TopExp_Explorer +from OCC.TopoDS import topods, TopoDS_Shape +from OCC.Quantity import Quantity_NOC_BLACK + + +def colorTheEdges(shp, display,color,width): + shapeList = [] + Ex = TopExp_Explorer(shp,TopAbs_EDGE) + ctx = display.Context + while Ex.More(): + aEdge = topods.Edge(Ex.Current()) + ais_shape = AIS_Shape(aEdge).GetHandle() + ctx.SetColor(ais_shape,color, False) + ctx.SetWidth(ais_shape,width, False) + ctx.Display(ais_shape, False) + Ex.Next() + +def setDefaultEdgeStyle(shp, display): + colorTheEdges(shp, display, Quantity_NOC_BLACK, 1.5) + #return shps + + +def osdagDisplayShape (display, shapes,material=None, texture=None, color=None, transparency=None, update=False): + setDefaultEdgeStyle(shapes, display) + display.DisplayShape(shapes,material,texture,color,transparency,update = True) + + + + + + + + + + \ No newline at end of file -- cgit