Skip to content
Permalink
Browse files

Introduced ell primitive with example

  • Loading branch information...
Killthebug committed May 7, 2018
1 parent 1ec4e71 commit a0973c5b42615e0ef53ba9c876ee14992e1df937
Showing with 46 additions and 1 deletion.
  1. +31 −0 examples/elip.py
  2. +15 −1 python_brlcad_tcl/brlcad_tcl.py
@@ -0,0 +1,31 @@
import sys
import sys
import os
from math import atan
from math import degrees

from python_brlcad_tcl.brlcad_tcl import *

class elip_example(BrlCadModel):
def __init__(self, brl_db):
super(elip_example, self).__init__(brl_db)
v = (0, 0, 0)
a = (10, 0, 0)
b = (0, 10, 0)
c = (0, 0, 10)
brl_db.Ellipsoid("ellipsoid", v, a, b, c)

def main(argv):
#with wdb.WDB(argv[1], "My Database") as brl_db:
with brlcad_tcl(argv[1], "My Database") as brl_db:
new_ellipsoid = elip_example(brl_db)
# All units in the database file are stored in millimeters. This constrains
# the arguments to the mk_* routines to also be in millimeters.
# process the tcl script into a g database by calling mged
brl_db.save_g()
# process the g database into an STL file with a list of regions
#brl_db.save_stl(['room', 'mainroof', 'roof_window1', 'roof_window2'])
brl_db.save_stl(['elip_example'])

if __name__ == "__main__":
main(sys.argv)
@@ -871,8 +871,22 @@ def Cylinder_hyperbolic(self, name, rhc,vertex, height_vector, bvector, half_wid
def Cylinder_parabolic(self, name, rpc, vertex, height_vector, bvector, half_width):
is_string(name)

def Ellipsoid(self, name, ell, vertex, avector, bvector, cvector):
def Ellipsoid(self, name, vertex, avector, bvector, cvector):
is_string(name)
is_truple(vertex)
is_truple(avector)
is_truple(bvector)
is_truple(cvector)
v1, v2, v3 = vertex
a1, a2, a3 = avector
b1, b2, b3 = bvector
c1, c2, c3 = cvector
self.script_string_list.append('in {} ell {} {} {} {} {} {} {} {} {} {} {} {}\n'.format(name,
v1, v2, v3,
a1, a2, a3,
b1, b2, b3,
c1, c2, c3))
return name

def Hyperboloid_elliptical(self, name, ehy, vertex, height_vector, avector, bscalar, apex_to_asymptote):
is_string(name)

0 comments on commit a0973c5

Please sign in to comment.
You can’t perform that action at this time.