Esempio n. 1
0
    def frame_at(self, u, v):
        """Compute the local frame at a point on the curve.

        Parameters
        ----------
        u : float
        v : float

        Returns
        -------
        :class:`compas.geometry.Frame`
        """
        result, plane = self.rhino_surface.FrameAt(u, v)
        if result:
            return plane_to_compas_frame(plane)
Esempio n. 2
0
    def frame_at(self, t):
        """Compute the local frame at a point on the curve.

        Parameters
        ----------
        t : float
            The value of the curve parameter.

        Returns
        -------
        :class:`compas.geometry.Frame`
            The corresponding local frame.

        """
        plane = self.rhino_curve.FrameAt(t)
        return plane_to_compas_frame(plane)
Esempio n. 3
0
    def RunScript(self, robot, visual_mesh, collision_mesh, tcf_plane):
        if robot and robot.client and robot.client.is_connected and visual_mesh:
            if not collision_mesh:
                collision_mesh = visual_mesh

            c_visual_mesh = RhinoMesh.from_geometry(visual_mesh).to_compas()
            c_collision_mesh = RhinoMesh.from_geometry(collision_mesh).to_compas()

            if not tcf_plane:
                frame = Frame.worldXY()
            else:
                frame = plane_to_compas_frame(tcf_plane)
            tool = Tool(c_visual_mesh, frame, c_collision_mesh)

            scene = PlanningScene(robot)
            robot.attach_tool(tool)
            scene.add_attached_tool()

        return robot