Пример #1
0
    def get_circle(self):
        """Get :class:`compas.geometry.Circle` representing fabrication element.

        Returns
        -------
        :class:`compas.geometry.Circle`
        """
        plane = cg.Plane(self.get_pt(), self.get_normal())
        return cg.Circle(plane, self.get_compressed_radius())
Пример #2
0
def cgframe_to_rgplane(frame):  # type: (compas.geometry.Frame) -> Rhino.Geometry.Plane
    """Convert :class:`compas.geometry.Frame` to :class:`Rhino.Geometry.Plane`.

    Parameters
    ----------
    frame : :class:`compas.geometry.Frame`
        Frame to convert.

    Returns
    -------
    :class:`Rhino.Geometry.Plane`
        Resulting plane.
    """
    plane = cg.Plane(frame.point, frame.normal)
    return cgplane_to_rgplane(plane)
Пример #3
0
def rgplane_to_cgplane(
        plane):  # type: (Rhino.Geometry.Plane) -> compas.geometry.Plane
    """Convert :class:`Rhino.Geometry.Plane` to :class:`compas.geometry.Plane`.

    Parameters
    ----------
    plane : :class:`Rhino.Geometry.Plane`
        Plane object to convert

    Returns
    -------
    :class:`compas.geometry.Plane`
        Resulting plane object

    Notes
    -----
    Unlike a :class:`Rhino.Geometry.Plane` the :class:`compas.geometry.Plane`
    does not store X-axis and Y-axis vectors. See :meth:`compas.geometry.Frame.from_plane` docstring.
    """
    return cg.Plane(rgpoint_to_cgpoint(plane.Origin),
                    rgvector_to_cgvector(plane.Normal))
Пример #4
0
# ==============================================================================
# Boundary plane
# ==============================================================================

a = cablenet.vertex_coordinates(SOUTH[0])
b = cablenet.vertex_coordinates(SOUTH[-1])

xaxis = subtract_vectors(b, a)
yaxis = [0, 0, 1.0]
zaxis = cross_vectors(xaxis, yaxis)
xaxis = cross_vectors(yaxis, zaxis)

frame = Frame([0, 0, 0], xaxis, yaxis)
point = add_vectors(a, scale_vector(frame.zaxis, OFFSET))
normal = frame.zaxis
plane = cg.Plane(point, normal)

# ==============================================================================
# Intersections
# ==============================================================================

intersections = []

for key in SOUTH:
    a = cablenet.vertex_coordinates(key)
    r = cablenet.residual(key)
    b = add_vectors(a, r)
    x = intersection_line_plane((a, b), plane)

    intersections.append(Point(*x))