Пример #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)
Пример #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
Пример #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)
Пример #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)
Пример #5
0
 def points(self):
     if self.rhino_curve:
         return [point_to_compas(point) for point in self.rhino_curve.Points]
Пример #6
0
 def end(self):
     if self.rhino_curve:
         return point_to_compas(self.rhino_curve.PointAtEnd)
Пример #7
0
 def start(self):
     if self.rhino_curve:
         return point_to_compas(self.rhino_curve.PointAtStart)