Example #1
0
 def from_data(cls, data):
     cylinder = Cylinder.from_data(data)
     vcylinder = cls(cylinder)
     return vcylinder
Example #2
0
        """
        cylinder = self.copy()
        cylinder.transform(transformation)
        return cylinder


# ==============================================================================
# Main
# ==============================================================================

if __name__ == "__main__":
    from compas.geometry import Frame
    from compas.geometry import Transformation
    from compas.geometry import Circle
    from compas.geometry import Cylinder

    cylinder = Cylinder(Circle(Plane.worldXY(), 5), 7)
    frame = Frame([1, 1, 1], [0.68, 0.68, 0.27], [-0.67, 0.73, -0.15])
    print(frame.normal)
    T = Transformation.from_frame(frame)
    cylinder.transform(T)
    print(cylinder)

    print(Plane.worldXY().data)
    data = {'circle': Circle(Plane.worldXY(), 5).data, 'height': 7.}
    cylinder = Cylinder.from_data(data)
    print(cylinder)

    import doctest
    doctest.testmod()
Example #3
0
 def data(self, data):
     self.cylinder = Cylinder.from_data(data)