コード例 #1
0
 def revalidate_bounding_box(self):
     GLReferentBase.revalidate_bounding_box(self)
     self.update_normal()
     self.bounding_box.extend_with_point(self.l_l)
     self.bounding_box.extend_with_point(self.l_h)
     self.bounding_box.extend_with_point(self.h_l)
     self.bounding_box.extend_with_point(self.h_h)
コード例 #2
0
ファイル: tetra.py プロジェクト: molmod/zeobuilder
    def draw(self):
        GLReferentBase.draw(self)
        ColorMixin.draw(self)
        vb = context.application.vis_backend
        p0,p1,p2,p3 = [target.get_frame_relative_to(self.parent).t for target in self.get_targets()]

        def get_normal(a,b,c,d):
            result = numpy.cross(a-b,c-b)
            norm = numpy.linalg.norm(result)
            if norm < 1e-8:
                return numpy.zeros(3,float)
            else:
                result /= norm
            if numpy.dot(result,d-b) > 0:
                result *= -1
            return result

        vb.draw_triangles((
            get_normal(p0,p1,p2,p3),
            [p0,p1,p2],
        ), (
            get_normal(p1,p2,p3,p0),
            [p1,p2,p3],
        ), (
            get_normal(p2,p3,p0,p1),
            [p2,p3,p0],
        ), (
            get_normal(p3,p0,p1,p2),
            [p3,p0,p1],
        ))
コード例 #3
0
ファイル: plane.py プロジェクト: woutersmet/Zeo_thesis
 def revalidate_bounding_box(self):
     GLReferentBase.revalidate_bounding_box(self)
     self.update_normal()
     self.bounding_box.extend_with_point(self.l_l)
     self.bounding_box.extend_with_point(self.l_h)
     self.bounding_box.extend_with_point(self.h_l)
     self.bounding_box.extend_with_point(self.h_h)
コード例 #4
0
ファイル: vector.py プロジェクト: woutersmet/Zeo_thesis
 def initnonstate(self):
     GLReferentBase.initnonstate(self)
     self.orientation = Complete()
     self.set_children([
         SpatialReference(prefix="Begin"),
         SpatialReference(prefix="End")
     ])
コード例 #5
0
ファイル: tetra.py プロジェクト: molmod/zeobuilder
 def initnonstate(self):
     GLReferentBase.initnonstate(self)
     self.set_children([
         SpatialReference(prefix="Corner1"),
         SpatialReference(prefix="Corner2"),
         SpatialReference(prefix="Corner3"),
         SpatialReference(prefix="Corner4"),
     ])
コード例 #6
0
ファイル: plane.py プロジェクト: woutersmet/Zeo_thesis
 def draw(self):
     GLReferentBase.draw(self)
     ColorMixin.draw(self)
     self.update_normal()
     vb = context.application.vis_backend
     vb.draw_quads((
         self.normal,
         [
             self.l_l + 0.001*self.normal,
             self.l_h + 0.001*self.normal,
             self.h_h + 0.001*self.normal,
             self.h_l + 0.001*self.normal,
         ],
     ), (
         - self.normal,
         [
             self.h_l - 0.001*self.normal,
             self.h_h - 0.001*self.normal,
             self.l_h - 0.001*self.normal,
             self.l_l - 0.001*self.normal,
         ],
     ))
コード例 #7
0
 def draw(self):
     GLReferentBase.draw(self)
     ColorMixin.draw(self)
     self.update_normal()
     vb = context.application.vis_backend
     vb.draw_quads((
         self.normal,
         [
             self.l_l + 0.001 * self.normal,
             self.l_h + 0.001 * self.normal,
             self.h_h + 0.001 * self.normal,
             self.h_l + 0.001 * self.normal,
         ],
     ), (
         -self.normal,
         [
             self.h_l - 0.001 * self.normal,
             self.h_h - 0.001 * self.normal,
             self.l_h - 0.001 * self.normal,
             self.l_l - 0.001 * self.normal,
         ],
     ))
コード例 #8
0
ファイル: tetra.py プロジェクト: molmod/zeobuilder
 def revalidate_bounding_box(self):
     GLReferentBase.revalidate_bounding_box(self)
     for target in self.get_targets():
         self.bounding_box.extend_with_point(target.get_frame_relative_to(self.parent).t)
コード例 #9
0
ファイル: vector.py プロジェクト: woutersmet/Zeo_thesis
 def define_target(self, reference, new_target):
     GLReferentBase.define_target(self, reference, new_target)
     self.invalidate_boundingbox_list()
     self.invalidate_draw_list()
コード例 #10
0
ファイル: vector.py プロジェクト: woutersmet/Zeo_thesis
 def target_moved(self, reference, target):
     GLReferentBase.target_moved(self, reference, target)
     self.invalidate_boundingbox_list()
     self.invalidate_draw_list()
コード例 #11
0
 def set_targets(self, targets, init=False):
     self.set_children([SpatialReference("Point") for target in targets])
     GLReferentBase.set_targets(self, targets, init)
コード例 #12
0
ファイル: vector.py プロジェクト: woutersmet/Zeo_thesis
 def revalidate_draw_list(self):
     if self.gl_active:
         GLReferentBase.revalidate_draw_list(self)
コード例 #13
0
 def target_moved(self, reference, target):
     GLReferentBase.target_moved(self, reference, target)
     self.invalidate_boundingbox_list()
     self.invalidate_draw_list()
コード例 #14
0
 def define_target(self, reference, new_target):
     GLReferentBase.define_target(self, reference, new_target)
     self.invalidate_boundingbox_list()
     self.invalidate_draw_list()
コード例 #15
0
ファイル: vector.py プロジェクト: yuhangwang/zeobuilder
 def initnonstate(self):
     GLReferentBase.initnonstate(self)
     self.orientation = Complete.identity()
     self.set_children(
         [SpatialReference(prefix="Begin"),
          SpatialReference(prefix="End")])
コード例 #16
0
ファイル: vector.py プロジェクト: yuhangwang/zeobuilder
 def revalidate_draw_list(self):
     if self.gl_active:
         GLReferentBase.revalidate_draw_list(self)
コード例 #17
0
ファイル: plane.py プロジェクト: woutersmet/Zeo_thesis
 def set_targets(self, targets, init=False):
     self.set_children([SpatialReference("Point") for target in targets])
     GLReferentBase.set_targets(self, targets, init)