viter.alex
Looking around for some CAD
Hello all!
I'm very newbie with pytonocc. Till yesterday I knew nothing about it.
I need to process step files: get name of shape, volume, surface and so on.
Trying to do like this:
And get a result that is different from FreeCad. On file un045831A-00Rev--1.stp I got a list of errors which I don't understand and no volume at all:
I'm very newbie with pytonocc. Till yesterday I knew nothing about it.
I need to process step files: get name of shape, volume, surface and so on.
Trying to do like this:
Python:
from OCC.Core.GProp import GProp_GProps
from OCC.Core.BRepGProp import brepgprop_VolumeProperties
from OCC.Extend.DataExchange import read_step_file
files = ["path1", "path2"]
prop = GProp_GProps()
tolerance = 1e-5 # Adjust to your liking
for file in files:
my_shape = read_step_file(file)
volume = brepgprop_VolumeProperties(my_shape, prop)
print(volume)
Code:
** Model Complete Check List **
Check:1 -- Global Check
Complex Type incorrect : SOLID_ANGLE_UNIT / SI_UNIT ...
Complex Type incorrect : NAMED_UNIT / LENGTH_UNIT ...
Check:2 -- Entity (n0:id) 170:#176 Type:(NAMED_UNIT,PLANE_ANGLE_UNIT,SI_UNIT)
Parameter n0.1 (dimensions) not Derived
Check:3 -- Entity (n0:id) 171:#177 Type:(NAMED_UNIT,SI_UNIT,SOLID_ANGLE_UNIT)
Count of Parameters is not 2 for si_unit
Parameter n0.1 (dimensions) not Derived
Check:4 -- Entity (n0:id) 804:#821 Type:(LENGTH_UNIT,NAMED_UNIT,SI_UNIT)
Complex Record n0.1235, member type LENGTH_UNIT not in alphabetic order
Parameter n0.1 (dimensions) not Derived
Complex Record n0.1235, member type SI_UNIT not in alphabetic order