コード例 #1
0
    def test_sphere_probe(self):
        radius = 20
        minPitch = zencad.deg(-10)
        maxPitch = zencad.deg(20)
        yaw = zencad.deg(130)

        zencad.sphere(r=radius)
        zencad.sphere(r=radius, yaw=yaw)
        zencad.sphere(r=radius, pitch=(minPitch, maxPitch))
        zencad.sphere(r=radius, yaw=yaw, pitch=maxPitch)
        zencad.sphere(r=radius, yaw=yaw, pitch=(minPitch, maxPitch))
コード例 #2
0
    def showEvent(self, ev):
        if self.inited != True:

            if self.showmarkers:
                zencad.lazifier.disable_lazy()
                self.msphere = zencad.sphere(1)
                self.MarkerQController = self.scene.add(
                    self.msphere, zencad.Color(1, 0, 0))
                self.MarkerWController = self.scene.add(
                    self.msphere, zencad.Color(0, 1, 0))
                zencad.lazifier.restore_lazy()

            self.viewer = zencad.Viewer(self.scene)
            self.view = self.viewer.create_view()
            self.view.set_window(int(self.winId()))
            self.view.set_gradient()

            self.set_orient1()
            self.view.set_triedron()
            self.viewer.set_triedron_axes()

            if self.showmarkers:
                self.MarkerQController.hide(True)
                self.MarkerWController.hide(True)

            self.view.redraw()
            self.inited = True
        else:
            self.update()
            self.view.redraw()
コード例 #3
0
    def test_difference_probe(self):
        a = zencad.box(10)
        b = zencad.sphere(10)
        c = zencad.cone(5, 2, h=20)

        f1 = zencad.difference([a, b, c])
        f2 = a - b - c
        f3 = zencad.difference([c, a, b])
        f4 = c - a - b
コード例 #4
0
    def test_intersect_probe(self):
        a = zencad.box(10)
        b = zencad.sphere(10)
        c = zencad.cone(5, 2, h=20)

        f1 = zencad.intersect([a, b, c])
        f2 = a ^ b ^ c
        f3 = zencad.intersect([c, a, b])
        f4 = c ^ a ^ b
コード例 #5
0
    def create_qwmarkers(self):
        if self.showmarkers:
            zencad.lazifier.disable_lazy()
            self.msphere = zencad.sphere(1)
            self.MarkerQController = self.scene.add(self.msphere,
                                                    zencad.Color(1, 0, 0))
            self.MarkerWController = self.scene.add(self.msphere,
                                                    zencad.Color(0, 1, 0))
            zencad.lazifier.restore_lazy()

            self.MarkerQController.hide(True)
            self.MarkerWController.hide(True)
コード例 #6
0
    def test_union_probe(self):
        a = zencad.box(10)
        b = zencad.sphere(10)
        c = zencad.cone(5, 2, h=20)

        f1 = zencad.union([a, b, c])
        f2 = a + b + c
        f3 = zencad.union([c, a, b])
        f4 = c + a + b

        self.assertEqual(lexsort(f1.vertices()), lexsort(f2.vertices()))
        self.assertEqual(lexsort(f1.vertices()), lexsort(f3.vertices()))
コード例 #7
0
 def test_halfspace_probe(self):
     (zencad.sphere(r=10) - zencad.halfspace().rotateX(zencad.deg(150)))
     (zencad.sphere(r=10) ^ zencad.halfspace().rotateX(zencad.deg(150)))