Hi Petar, 3 links:
1) use StepOCAF_Export<http://code.google.com/p/pythonocc/source/browse/trunk/src/addons/Utils/DataExchange/STEP.py?r=1115> it supports colors & layers ( not all readers support 'em rhino does... ) 2) here's an example...<http://code.google.com/p/pythonocc/source/browse/trunk/src/examples/Level2/DataExchange/export_multi_to_step_colors_layers_ocaf.py?spec=svn1115&r=1115> <http://code.google.com/p/pythonocc/source/browse/trunk/src/examples/Level2/DataExchange/export_multi_to_step_colors_layers_ocaf.py?spec=svn1115&r=1115>3) use OCC.Utils.Construct<http://code.google.com/p/pythonocc/source/browse/trunk/src/addons/Utils/Construct.py?r=1115>to make your code much more pythonic. Happy to have you on board. FreeCAD is a great project & the link with pythonocc is terrific work! -jelle On Wed, Dec 29, 2010 at 2:44 PM, Petar <petar.peri...@cadcam.hr> wrote: > Hi, > > My name is Petar Perisin, And I'm trying to connect FreeCAD and pythonOCC. > I have posted 2 messages on web site, so here they go: > > Hi, > > I have been playing with this STEP export. I have also found > pythonocc-examples project on code.google.com (you should also include > this google code project on your web site, because there is no link to it > here – I have found the link on google). Over here there is test_XDE.py and > the program creates some moduels, colors them and exports STEP with colors. > Couple of questions: > > 1. Over there there StepOCAF_Export class (from the Utils.DataExchange > package) is not used. It Uses STEPCAFControl writer. Is this the same thing > (it confuses me a little bit) or am I wrong? > > 2. I know that you were talking about how StepOCAF supports layers and > colors. This layers is what I’m interested in. Are this accually ‘Parts’ > that appear after I import Step file into another program, so I can see that > Step is accually made from many parts (XDE_test.step has three parts – 2 > boxes and a cylinder)? > > 3. Code does not seem to work untill you comment lines from 69-79 (and, of > course, uncomment lines 83-86). He reports error on line 74 – “Attribute > Error: ‘TColStd_ListIteratorOfListOfInteger’ object has no attribute ‘Value’ > “. It is probably connected to line 72, where this is assigned. How to fix > this (in other way than comment lines from 69 to 79) > > 4. I have been looking through the code (newbie look) and I have figured > where new document is created, where shapes are created, where components > are referenced in assembly and coloured after that. But, as hard as I try I > can not figure out what do lines 69-79 do? What do they do? > > 5. Is there a way to assign colors based on Red-Green-Blue values (this was > not used here) and if yes, what is the range for this values (is it 0-1 > float values like in FreeCAD or is it 0-256 integer values) – can you give > me an example of this? > > Thank you very much for pythonOCC > > > > And the second one is: > > Hi, > > I wanted to explain what am I doing. I’m trying to export complex shapes > from FreeCAD to STEP with colors using pythonOCC. So far I have managed to > do that with simple shapes like sphere, box, cone ect. But how to export cut > between sphere and a box. I saw another example test_cut.py, and from there > I took and modified a few things: > > from OCC import BRepPrimAPI, BRepBuilderAPI, gp, Geom, STEPControl,\ > BRepAlgoAPI > > R = 20. > sphere = BRepPrimAPI.BRepPrimAPI_MakeSphere(R) > box = BRepPrimAPI.BRepPrimAPI_MakeBox(100,100,100) > cut = BRepAlgoAPI.BRepAlgoAPI_Cut(box.Shape(), sphere.Shape()) > > now, how to export ‘cut’ as STEP with color. He reports some error that > ‘cut’ is of different type. How to make ‘cut’ be good type? > > > _______________________________________________ > Pythonocc-users mailing list > Pythonocc-users@gna.org > https://mail.gna.org/listinfo/pythonocc-users > >
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users