Wed, 05/28/2008 - 23:30
Forums:
Hi all,
I'm just wondering whether there is a way to take the snapshot of the STEP file and save it as Jpeg or any graphical format via Open Cascade?
Also, it will be helpful if there is a code(or program) to convert STEP to jpeg?
Thanks in advance
winthan
Thu, 05/29/2008 - 10:16
Check out the inport export sample. It demonstrates how to take snapshot using V3d_View::Dump method.
Thu, 05/29/2008 - 17:27
STEPControl_Reader reader;
reader.ReadFile("C:\\Documents and Settings\\jing\\Desktop\\test_files\\14101110.stp");
cout<<"Number of roots in STEP file: "<< NbRoots<
Thu, 05/29/2008 - 17:36
another way , if you need only the outlines (wireframe, not shaded) is to use the HLR algorithms which returns you a 2d result.
after that, you can create an image (vectorial or bitmap) and "draw" the lines with MoveTo / LineTo like code
Stephane
Thu, 05/29/2008 - 17:41
can u give me more details like which classes and functions to use?
thanks
Thu, 05/29/2008 - 18:16
check the code for the 12_HLR sample (SelectionDialog.cpp .h in 12_HLR folder and ISession2d_Shape.cpp .h in the common folder)
basically, you create a projector (HLRAlgo_Projector) and you are using it with HLRBRep_Algo.
I don't have my example code with me right now, but I can send you an example how to use it next week (If i don't forget ;-) ).
Stephane
Thu, 05/29/2008 - 18:36
TopoDS_Shape result = reader.OneShape();
thanks
btw, do you have the sample code for using V3d_Viewer?
I think that way is much easier
cuz i already have the shape object and i just need to find out a way to get it displayed on v3d viewer but i am not seeing any method in v3dview accepts my shape(result) parameter.
thanks
winthan