Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / basic_properties.py
1 # Basic Properties
2
3 import geompy
4 import math
5
6 # create a box
7 box = geompy.MakeBoxDXDYDZ(100,30,100)
8 props = geompy.BasicProperties(box)
9 print "\nBox 100x30x100 Basic Properties:"
10 print " Wires length: ", props[0]
11 print " Surface area: ", props[1]
12 print " Volume      : ", props[2]
13 length = math.sqrt((props[0] - 1840)*(props[0] - 1840))
14 area = math.sqrt((props[1] - 32000)*(props[1] - 32000))
15 volume = math.sqrt((props[2] - 300000)*(props[2] - 300000))
16 if length > 1e-7 or area > 1e-7 or volume > 1e-7:
17     print "While must be:"
18     print " Wires length: ", 1840
19     print " Surface area: ", 32000
20     print " Volume      : ", 300000.