def _desk(self, scaleA, scaleB, deskDX, deskDY, deskDZ): style = self._deskStyle() scale = scaleA / scaleB xBox, yBox, zBox = 1500 * scale, 1000 * scale, 40 * scale desk = BRepPrimAPI_MakeBox( gp_Pnt(-xBox / 2 + deskDX, -yBox / 2 + deskDY, -zBox + deskDZ), xBox, yBox, zBox) self._drawShape(desk.Solid(), style) scalePoint = gp_Pnt(-xBox / 2 + deskDX, -yBox / 2 + deskDY, zBox / 3 + deskDZ) self._drawLabel(scalePoint, 'A0 M' + str(scaleB) + ':' + str(scaleA), style)
class BoxBuilder(object): """ Base class for building boxes. """ def __init__(self, *args): self._builder = BRepPrimAPI_MakeBox(*args) @property def shell(self): """ :return: The box as a shell. :rtype: afem.topology.entities.Shell """ return Shell(self._builder.Shell()) @property def solid(self): """ :return: The box as a solid. :rtype: afem.topology.entities.Solid """ return Solid(self._builder.Solid()) @property def bottom_face(self): """ :return: The bottom face. :rtype: afem.topology.entities.Face """ return Face(self._builder.BottomFace()) @property def back_face(self): """ :return: The back face. :rtype: afem.topology.entities.Face """ return Face(self._builder.BackFace()) @property def front_face(self): """ :return: The front face. :rtype: afem.topology.entities.Face """ return Face(self._builder.FrontFace()) @property def left_face(self): """ :return: The left face. :rtype: afem.topology.entities.Face """ return Face(self._builder.LeftFace()) @property def right_face(self): """ :return: The right face. :rtype: afem.topology.entities.Face """ return Face(self._builder.RightFace()) @property def top_face(self): """ :return: The top face. :rtype: afem.topology.entities.Face """ return Face(self._builder.TopFace())