Example #1
0
 def __init__(self,
              name,
              file_name,
              x_dim=350,
              y_dim=350,
              tallness=20,
              mat=Transform.unit(),
              copy=False):
     Primitive.__init__(self, name=name)
     if not os.path.isfile(file_name):
         raise ValueError("File {} does not exist !".format(file_name))
     self.file_name = file_name
     self.x_dim = x_dim
     self.y_dim = y_dim
     self.tallness = tallness
     self.mat = Transform(mat, copy=copy, force=True)
Example #2
0
 def __init__(self, name, file_name, x_dim=350, y_dim=350, tallness=20, mat=Transform.unit(), copy=False):
     Primitive.__init__(self, name=name)
     if not os.path.isfile(file_name):
         raise ValueError("File {} does not exist !".format(file_name))
     self.file_name = file_name
     self.x_dim = x_dim
     self.y_dim = y_dim
     self.tallness = tallness
     self.mat = Transform(mat, copy=copy, force=True)
Example #3
0
 def ebm(self,
         name,
         file_name,
         x_dim=350,
         y_dim=350,
         tallness=20,
         mat=Transform.unit()):
     libwdb.mk_ebm(self.db_fp, name, file_name, x_dim, y_dim, tallness,
                   cta.transform(mat))
Example #4
0
 def __init__(self,
              name,
              file_name,
              x_dim=1,
              y_dim=1,
              z_dim=1,
              low_thresh=0,
              high_thresh=128,
              cell_size=(1, 1, 1),
              mat=Transform.unit(),
              copy=False):
     Primitive.__init__(self, name=name)
     if not os.path.isfile(file_name):
         raise ValueError("File {} does not exist !".format(file_name))
     self.file_name = file_name
     self.x_dim = x_dim
     self.y_dim = y_dim
     self.z_dim = z_dim
     self.low_thresh = low_thresh
     self.high_thresh = high_thresh
     self.cell_size = Vector(cell_size, copy=copy)
     self.mat = Transform(mat, copy=copy, force=True)
Example #5
0
 def vol(self,
         name,
         file_name,
         x_dim=1,
         y_dim=1,
         z_dim=1,
         low_thresh=0,
         high_thresh=128,
         cell_size=(1, 1, 1),
         mat=Transform.unit()):
     libwdb.mk_vol(self.db_fp, name, file_name, x_dim, y_dim, z_dim,
                   low_thresh, high_thresh, cta.point(cell_size),
                   cta.transform(mat))
Example #6
0
 def __init__(
     self,
     name,
     file_name,
     x_dim=1,
     y_dim=1,
     z_dim=1,
     low_thresh=0,
     high_thresh=128,
     cell_size=(1, 1, 1),
     mat=Transform.unit(),
     copy=False,
 ):
     Primitive.__init__(self, name=name)
     if not os.path.isfile(file_name):
         raise ValueError("File {} does not exist !".format(file_name))
     self.file_name = file_name
     self.x_dim = x_dim
     self.y_dim = y_dim
     self.z_dim = z_dim
     self.low_thresh = low_thresh
     self.high_thresh = high_thresh
     self.cell_size = Vector(cell_size, copy=copy)
     self.mat = Transform(mat, copy=copy, force=True)
Example #7
0
 def vol(
     self,
     name,
     file_name,
     x_dim=1,
     y_dim=1,
     z_dim=1,
     low_thresh=0,
     high_thresh=128,
     cell_size=(1, 1, 1),
     mat=Transform.unit(),
 ):
     libwdb.mk_vol(
         self.db_fp,
         name,
         file_name,
         x_dim,
         y_dim,
         z_dim,
         low_thresh,
         high_thresh,
         cta.point(cell_size),
         cta.transform(mat),
     )
Example #8
0
 def ebm(self, name, file_name, x_dim=350, y_dim=350, tallness=20, mat=Transform.unit()):
     libwdb.mk_ebm(self.db_fp, name, file_name, x_dim, y_dim, tallness, cta.transform(mat))
                "box1.s",
                "wedge1.s",
                "arb4.s",
                "arb5.s",
                "arb6.s",
                "arb7.s",
                "arb8.s",
                "ellipsoid.s",
                "torus.s",
                "rcc.s",
                "tgc.s",
                "cone.s",
                "trc.s",
                "rpc.s",
                "rhc.s",
                "epa.s",
                "ehy.s",
                "hyperboloid.s",
                "eto.s",
                primitives.leaf("arbn.s", Transform.translation(1, 0, 0)),
                "particle.s",
                "pipe.s",
            ),
            shader="plastic {di .8 sp .2}",
            rgb_color=(64, 180, 96)
        )

    with WDB("test_wdb.g") as brl_db:
        for x in brl_db.ls():
            print brl_db.lookup(x)
Example #10
0
                          "box1.s",
                          "wedge1.s",
                          "arb4.s",
                          "arb5.s",
                          "arb6.s",
                          "arb7.s",
                          "arb8.s",
                          "ellipsoid.s",
                          "torus.s",
                          "rcc.s",
                          "tgc.s",
                          "cone.s",
                          "trc.s",
                          "rpc.s",
                          "rhc.s",
                          "epa.s",
                          "ehy.s",
                          "hyperboloid.s",
                          "eto.s",
                          primitives.leaf("arbn.s",
                                          Transform.translation(1, 0, 0)),
                          "particle.s",
                          "pipe.s",
                      ),
                      shader="plastic {di .8 sp .2}",
                      rgb_color=(64, 180, 96))

    with WDB("test_wdb.g") as brl_db:
        for x in brl_db.ls():
            print brl_db.lookup(x)