def draw_points(self, points, layer=None, clear_layer=False, redraw=False): # every point must be of the form: # - point: XYZ # - size: {small, medium, large} # - color: RGB # - name: None # - label? draw_points(points, layer=layer)
def draw_vertices(self, radius=0.05, keys=None): self.clear_vertices() self.clear_vertexlabels() keys = keys or list(self.datastructure.vertices()) points = [0] * len(keys) for c, key in enumerate(keys): points[c] = { 'pos': self.datastructure.vertex_coordinates(key), 'layer': self.layer, 'name': 'V{0}'.format(key), 'radius': radius } self.vertex_objects = draw_points(points=points)
def closest_point(self, point, maxdist=None, return_param=False): raise NotImplementedError def closest_points(self, points, maxdist=None): raise NotImplementedError # ============================================================================== # Main # ============================================================================== if __name__ == '__main__': from compas_blender.utilities import draw_points from compas_blender.utilities import get_object_by_name object = get_object_by_name(name='BezierCurve') curve = BlenderCurve(object=object) print(curve) print(curve.control_points()) print(curve.control_point_coordinates()) points = [{ 'pos': i, 'radius': 0.1 } for i in curve.divide(number_of_segments=5)] draw_points(points=points)