Exemplo n.º 1
0
 def __getitem__(self, index):
     try:
         u, v = index
     except TypeError:
         return self.points[index]
     else:
         point = self.rhino_surface.Points.GetControlPoint(u, v).Location
         return point_to_compas(point)
Exemplo n.º 2
0
 def points(self):
     points = []
     for i in range(self.rhino_surface.Points.CountU):
         row = []
         for j in range(self.rhino_surface.Points.CountV):
             row.append(
                 point_to_compas(
                     self.rhino_surface.Points.GetControlPoint(i,
                                                               j).Location))
         points.append(row)
     return points
Exemplo n.º 3
0
    def point_at(self, u, v):
        """Compute a point on the surface.

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

        Returns
        -------
        :class:`compas.geometry.Point`
        """
        point = self.rhino_surface.PointAt(u, v)
        return point_to_compas(point)
Exemplo n.º 4
0
    def point_at(self, t):
        """Compute a point on the curve.

        Parameters
        ----------
        t : float
            The value of the curve parameter. Must be between 0 and 1.

        Returns
        -------
        :class:`compas.geometry.Point`
            the corresponding point on the curve.

        """
        point = self.rhino_curve.PointAt(t)
        return point_to_compas(point)
Exemplo n.º 5
0
 def points(self):
     if self.rhino_curve:
         return [point_to_compas(point) for point in self.rhino_curve.Points]
Exemplo n.º 6
0
 def end(self):
     if self.rhino_curve:
         return point_to_compas(self.rhino_curve.PointAtEnd)
Exemplo n.º 7
0
 def start(self):
     if self.rhino_curve:
         return point_to_compas(self.rhino_curve.PointAtStart)