Beispiel #1
0
 def plot_data(self):
     hatching = plot_data.HatchingSet(0.1)
     edge_style = plot_data.EdgeStyle(line_width=1)
     surface_style = plot_data.SurfaceStyle(hatching=hatching)
     contour = self.contour()
     plot_datas = contour.plot_data(edge_style=edge_style, surface_style=surface_style)
     return [plot_data.PrimitiveGroup(primitives=[plot_datas])]
Beispiel #2
0
    def plot_data(self):
        hatching = plot_data.HatchingSet(0.5, 3)
        edge_style = plot_data.EdgeStyle(line_width=1,
                                         color_stroke=BLUE,
                                         dashline=[])
        surface_style = plot_data.SurfaceStyle(color_fill=WHITE,
                                               opacity=1,
                                               hatching=hatching)

        pt1 = vm.Point2D(0, 0)
        pt2 = vm.Point2D(0, self.ly)
        pt3 = vm.Point2D(self.lx, self.ly)
        pt4 = vm.Point2D(self.lx, 0)
        c1 = vm.wires.Contour2D([
            vm.edges.LineSegment2D(pt1, pt2),
            vm.edges.LineSegment2D(pt2, pt3),
            vm.edges.LineSegment2D(pt3, pt4),
            vm.edges.LineSegment2D(pt4, pt1)
        ])
        contours = [c1]
        for i in range(5):
            vector = vm.Vector2D(random.uniform(0, 2), random.uniform(0, 2))
            c2 = c1.translation(vector, copy=True)
            contours.append(c2)

        plot_datas = [
            c.plot_data(edge_style=edge_style, surface_style=surface_style)
            for c in contours
        ]
        return plot_data.PrimitiveGroup(primitives=plot_datas)
Beispiel #3
0
    def plot_data(self, full_contour=True):
        hatching = plot_data.HatchingSet(0.1)
        edge_style = plot_data.EdgeStyle(line_width=1)
        surface_style = plot_data.SurfaceStyle(hatching=hatching)

        contour = self.contour(full_contour=full_contour)
        contour_data = contour.plot_data(edge_style=edge_style,
                                         surface_style=surface_style)
        return [plot_data.PrimitiveGroup(primitives=[contour_data])]
Beispiel #4
0
 def plot_data(self):
     edge_style = plot_data.EdgeStyle(line_width=1, color_stroke=RED)
     plot_datas = self.panel_combination.plot_data()
     circles = self.contour()
     plot_datas.extend([c.plot_data(edge_style=edge_style) for c in circles])
     return [plot_data.PrimitiveGroup(primitives=plot_datas)]