예제 #1
0
    def plot(self):
        """Add the points to the mayavi pipeline"""
        _scale = self.scene.camera.parallel_scale
        self.clear()

        if not np.any(self.tri):
            return

        fig = self.scene.mayavi_scene

        x, y, z = self.points.T

        if self.rep == 'Wireframe':
            rep = 'wireframe'
        else:
            rep = 'surface'

        src = pipeline.triangular_mesh_source(x, y, z, self.tri, figure=fig)
        surf = pipeline.surface(src, figure=fig, color=self.rgbcolor,
                                opacity=self.opacity,
                                representation=rep, line_width=1)

        self.src = src
        self.surf = surf

        self.sync_trait('visible', self.surf, 'visible')
        self.sync_trait('rgbcolor', self.surf.actor.property, 'color',
                        mutual=False)
        self.sync_trait('opacity', self.surf.actor.property, 'opacity')

        self.scene.camera.parallel_scale = _scale
예제 #2
0
    def plot(self):
        """Add the points to the mayavi pipeline"""
        _scale = self.scene.camera.parallel_scale
        self.clear()

        if not np.any(self.tri):
            return

        fig = self.scene.mayavi_scene

        x, y, z = self.points.T

        if self.rep == 'Wireframe':
            rep = 'wireframe'
        else:
            rep = 'surface'

        src = pipeline.triangular_mesh_source(x, y, z, self.tri, figure=fig)
        surf = pipeline.surface(src, figure=fig, color=self.rgbcolor,
                                opacity=self.opacity,
                                representation=rep, line_width=1)

        self.src = src
        self.surf = surf

        self.sync_trait('visible', self.surf, 'visible')
        self.sync_trait('rgbcolor', self.surf.actor.property, 'color',
                        mutual=False)
        self.sync_trait('opacity', self.surf.actor.property, 'opacity')

        self.scene.camera.parallel_scale = _scale
예제 #3
0
    def plot(self):
        """Add the points to the mayavi pipeline"""
        _scale = self.scene.camera.parallel_scale if not _testing_mode() else 1
        self.clear()

        if not np.any(self.tri):
            return

        fig = self.scene.mayavi_scene

        x, y, z = self.points.T

        if self.rep == "Wireframe":
            rep = "wireframe"
        else:
            rep = "surface"

        src = pipeline.triangular_mesh_source(x, y, z, self.tri, figure=fig)
        surf = pipeline.surface(
            src, figure=fig, color=self.rgbcolor, opacity=self.opacity, representation=rep, line_width=1
        )

        self.src = src
        self.surf = surf

        self.sync_trait("visible", self.surf, "visible")
        self.sync_trait("rgbcolor", self.surf.actor.property, "color", mutual=False)
        self.sync_trait("opacity", self.surf.actor.property, "opacity")

        if not _testing_mode():
            self.scene.camera.parallel_scale = _scale
예제 #4
0
    def plot(self):
        """Add the points to the mayavi pipeline"""
        _scale = self.scene.camera.parallel_scale if not _testing_mode() else 1
        self.clear()

        if not np.any(self.tri):
            return

        fig = self.scene.mayavi_scene

        x, y, z = self.points.T
        nn = complete_surface_info(dict(rr=self.points, tris=self.tri),
                                   verbose='error')['nn']
        if self.rep == 'Wireframe':
            rep = 'wireframe'
        else:
            rep = 'surface'

        src = pipeline.triangular_mesh_source(x, y, z, self.tri, figure=fig)
        src.data.point_data.normals = nn
        src.data.cell_data.normals = None
        surf = pipeline.surface(src,
                                figure=fig,
                                color=self.rgbcolor,
                                representation=rep,
                                line_width=1)
        surf.actor.property.backface_culling = True

        self.src = src
        self.surf = surf

        self.sync_trait('visible', self.surf, 'visible')
        self.sync_trait('rgbcolor',
                        self.surf.actor.property,
                        'color',
                        mutual=False)
        self.sync_trait('opacity', self.surf.actor.property, 'opacity')

        if not _testing_mode():
            self.scene.camera.parallel_scale = _scale