View Issue Details

IDProjectCategoryView StatusLast Update
0001580FreeCADFeaturepublic2014-06-14 12:48
Reporteruser123 Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Summary0001580: Adding transparency to povray output
DescriptionAdding transparency to povray's output probably just needs a patch for: src/Mod/Raytracing/App/RayFeature.cpp

I'm not familiar with the source code, so I just wrote down basic concept of what it should do. It needs to be adapted at the TODO marks, but I think it should be fairly quick, at least I hope :)
 
 
--- RayFeature.cpp 2014-06-12 02:46:21.406185671 +0100
+++ RayFeature_new.cpp 2014-06-12 02:49:12.419194188 +0100
@@ -67,14 +67,21 @@
     PovTools::writeShape(result,Name.c_str(),shape);
 
     // This must not be done in PovTools::writeShape!
+ const App::PropertyPercent& t = Transparency.getValue(); // TODO: please replace with correct type.
     const App::Color& c = Color.getValue();
     result << "// instance to render" << endl
- << "object {" << Name << endl
- << " texture {" << endl
- << " pigment {color rgb <"<<c.r<<","<<c.g<<","<<c.b<<">}" << endl
- << " finish {StdFinish } //definition on top of the project" << endl
- << " }" << endl
- << "}" << endl ;
+ << "object {" << Name << endl
+ << " texture {" << endl;
+ if (*t == 0) {
+ result << " pigment {color rgb <"<<c.r<<","<<c.g<<","<<c.b<<">}" << endl;
+ } else {
+ float trans = *t/100.0f; // TODO: this needs fixing, probably to format 0.xx or so;
+ result << " pigment {color rgb <"<<c.r<<","<<c.g<<","<<c.b<<"> transmit "<<t<<"<<}" << endl;
+ }:
+ result << " finish {StdFinish } //definition on top of the project" << endl
+ << " }" << endl
+ << "}" << endl ;
+
 
     // Apply the resulting fragment
     Result.setValue(result.str().c_str());
TagsNo tags attached.
FreeCAD Information

Activities

There are no notes attached to this issue.

Related Changesets

FreeCAD: master 00e041ff

2014-06-14 14:19:29

wmayer

Details Diff
+ fixes 0001580: Adding transparency to povray output Affected Issues
0001580
mod - src/Mod/Raytracing/App/RayFeature.cpp Diff File
mod - src/Mod/Raytracing/App/RayFeature.h Diff File
mod - src/Mod/Raytracing/Gui/Command.cpp Diff File

Issue History

Date Modified Username Field Change
2014-06-12 08:47 user123 New Issue
2014-06-14 12:48 wmayer Changeset attached => FreeCAD Master master 00e041ff
2014-06-14 12:48 wmayer Assigned To => wmayer
2014-06-14 12:48 wmayer Status new => closed
2014-06-14 12:48 wmayer Resolution open => fixed