Esempio n. 1
0
def common(event=None):
    # Create Box
    axe = gp_Ax2(gp_Pnt(10, 10, 10), gp_Dir(1, 2, 1))
    Box = BRepPrimAPI_MakeBox(axe, 60, 80, 100).Shape()
    # Create wedge
    Wedge = BRepPrimAPI_MakeWedge(60., 100., 80., 20.).Shape()
    # Common surface
    CommonSurface = BRepAlgoAPI_Common(Box, Wedge).Shape()

    display.EraseAll()
    ais_box = display.DisplayShape(Box)
    ais_wedge = display.DisplayShape(Wedge)
    display.Context.SetTransparency(ais_box, 0.8)
    display.Context.SetTransparency(ais_wedge, 0.8)
    display.DisplayShape(CommonSurface)
    display.FitAll()
Esempio n. 2
0
 def makeWedge(cls,
               xmin,
               ymin,
               zmin,
               z2min,
               x2min,
               xmax,
               ymax,
               zmax,
               z2max,
               x2max,
               pnt=Vector(0, 0, 0),
               dir=Vector(0, 0, 1)):
     """
     Make a wedge located in pnt
     By default pnt=Vector(0,0,0) and dir=Vector(0,0,1)
     """
     return cls(
         BRepPrimAPI_MakeWedge(gp_Ax2(pnt.toPnt(), dir.toDir()), xmin, ymin,
                               zmin, z2min, x2min, xmax, ymax, zmax, z2max,
                               x2max).Solid())
Esempio n. 3
0
 def create_shape(self):
     d = self.declaration
     self.shape = BRepPrimAPI_MakeWedge(d.axis, d.dx, d.dy, d.dz,
                                        d.itx)  #.Shape()
Esempio n. 4
0
 def create_shape(self):
     d = self.declaration
     self.shape = BRepPrimAPI_MakeWedge(coerce_axis(d.axis), d.dx, d.dy,
                                        d.dz, d.itx)