Beispiel #1
0
print (face.area())

solid = Solid().extrude(face, (0.,0.,0.), (0.,0.,5.))
print (solid)
print ('area = ', solid.area())
print ('volume = ', solid.volume())
viewer((face, e1), ('red', 'green'))
'''

e1 = Edge().createCircle(center=(0., 0., 0.), normal=(0., 0., 1.), radius=1.)
e2 = Edge().createCircle(center=(0., 0., 5.), normal=(0., 0., 1.), radius=1.5)
e3 = Edge().createCircle(center=(0., 0., 10.), normal=(0., 0., 1.), radius=1.0)
solid = Solid().loft((e1, e2, e3), True)
print(solid.volume())
Tools.writeSTEP(bytes('test.stp'.encode("utf-8")), solid)
viewer(solid)
'''
solid = Solid()
solid.readSTEP('test.stp')
solid.heal()
viewer(solid)
'''
'''
e1 = Edge().createCircle(center=(0.,0.,0.),normal=(0.,0.,1.),radius = 1.)
face = Face().createFace(e1)
print (face)
print (face.area())
print (face.inertia())

solid = Solid().extrude(face, (0.,0.,0.), (0.,0.,1.))
print (solid)
Beispiel #2
0
solid = Solid().extrude(face, (0.,0.,0.), (0.,0.,5.))
print (solid)
print ('area = ', solid.area())
print ('volume = ', solid.volume())
viewer((face, e1), ('red', 'green'))
'''


e1 = Edge().createCircle(center=(0.,0.,0.),normal=(0.,0.,1.),radius = 1.)
e2 = Edge().createCircle(center=(0.,0.,5.),normal=(0.,0.,1.),radius = 1.5)
e3 = Edge().createCircle(center=(0.,0.,10.),normal=(0.,0.,1.),radius = 1.0)
solid = Solid().loft((e1,e2,e3), True)
print (solid.volume())
Tools.writeSTEP(bytes('test.stp'.encode("utf-8")),solid)
viewer(solid)


'''
solid = Solid()
solid.readSTEP('test.stp')
solid.heal()
viewer(solid)
'''

'''
e1 = Edge().createCircle(center=(0.,0.,0.),normal=(0.,0.,1.),radius = 1.)
face = Face().createFace(e1)
print (face)
print (face.area())
print (face.inertia())
from occmodelviewer import viewer
from occmodel import *

solid = Solid()
solid.createCylinder((0., 0., 0.), (0., 0., 1.), 1.)
print(solid.centreOfMass())

view = viewer(interactive=True)
view.add(solid)
view.redraw()
#viewer(solid)
#viewer((solid,face,edge))
from occmodelviewer import viewer
from occmodel import *

solid = Solid()
solid.createCylinder((0.,0.,0.),(0.,0.,1.), 1.)
print(solid.centreOfMass())

view = viewer(interactive = True)
view.add(solid)
view.redraw()
#viewer(solid)
#viewer((solid,face,edge))