예제 #1
0
 def draw(self, show_normal=False, color='green'):
     for i, segment in enumerate(self.segments):
         plt.plot(segment[:, 0], segment[:, 1], color=color)
         if show_normal:
             normal = math2d.normal(segment)
             center = math2d.center(segment)
             plt.arrow(center[0], center[1], normal[0], normal[1], width=0.01, color=color)
예제 #2
0
 def draw(self, show_normal=False, color='green'):
     for i, segment in enumerate(self.segments):
         plt.plot(segment[:, 0], segment[:, 1], color=color)
         if show_normal:
             normal = math2d.normal(segment)
             center = math2d.center(segment)
             plt.arrow(center[0],
                       center[1],
                       normal[0],
                       normal[1],
                       width=0.01,
                       color=color)
예제 #3
0
파일: solid.py 프로젝트: lynch829/PyTracer
    def draw(self, draw_normals=False):
        #segments = continuous_path_order(self.mesh.segments)
        segments = self.mesh.segments

        xs = np.ravel(segments[:, :, 0])
        ys = np.ravel(segments[:, :, 1])

        plt.fill(xs, ys, color=self.color)

        if draw_normals:
            for segment in segments:
                normal = math2d.normal(segment)
                center = math2d.center(segment)
                plt.arrow(center[0], center[1], normal[0], normal[1], width=0.01, color=self.color)
예제 #4
0
파일: solid.py 프로젝트: cat2tom/PyTracer
    def draw(self, draw_normals=False):
        #segments = continuous_path_order(self.mesh.segments)
        segments = self.mesh.segments

        xs = np.ravel(segments[:, :, 0])
        ys = np.ravel(segments[:, :, 1])

        plt.fill(xs, ys, color=self.color)

        if draw_normals:
            for segment in segments:
                normal = math2d.normal(segment)
                center = math2d.center(segment)
                plt.arrow(center[0],
                          center[1],
                          normal[0],
                          normal[1],
                          width=0.01,
                          color=self.color)