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)
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
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)
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)
def points(self): if self.rhino_curve: return [point_to_compas(point) for point in self.rhino_curve.Points]
def end(self): if self.rhino_curve: return point_to_compas(self.rhino_curve.PointAtEnd)
def start(self): if self.rhino_curve: return point_to_compas(self.rhino_curve.PointAtStart)