theraytracers / freecad-povray-render Goto Github PK
View Code? Open in Web Editor NEWFreeCAD workbench to render images of your model easily.
License: GNU Lesser General Public License v2.1
FreeCAD workbench to render images of your model easily.
License: GNU Lesser General Public License v2.1
First of all, pretty nice repo. I started to use the raytracing workbench with pov-ray last week. Then every time I had to tweak and change everything by hand after exporting the design. With this workbench I don't need this much of a tweak, this is awesome.
Alright, straight to the point. I am trying to simulate the behavior of a light pipe. This is a small acrylic plastic that is used inside devices to move the light from one LED to another point, for instance, in the interface of a case.
I am pretty new to what I am doing and what I want to achieve. But maybe this plugin could have or has a way to define internal reflection and parameters like that.
In short, this is what I want to achieve
http://www.imagico.de/pov/metamaterials.php
This is the code I am using to create this.
#include "glass.inc"
#declare M_light_pipe = material {
texture {
pigment {
color rgbf <1.0, 0.73333, 0.0, 0.8>
}
finish { F_Glass2 } // Behaves as an acrylic plastic
}
interior {
I_Glass
caustics 1.0
ior 1.4
dispersion 10.0
dispersion_samples 10
fade_distance 0.1
fade_power 0.2
fade_color <1.0, 0.73333, 0.0>
}
};
object {
Display
material {
M_light_pipe
}
texture {
pigment {
color rgb <1, 1, 1> transmit 0.9
}
finish { StdFinish }
}
}
My question is, does this plugin have a way to change these settings especially this internal
and the ior
?
If not, It would be nice to have a way to insert code manually before rendering, so it could be a txt object inside of the Freecad, with extra code to add, then it adds automatically before rendering something.
What do you think?
I am testing this workbench and it looks promising.
I would like to automate what I am doing now through the UI by scripting it via python. Is it possible ? and if so, would you have some doc/examples to do so ? at the end, I would like to set via scripting: lights, camera (instead of depending of the current view), running the render, retrieving the rendered image and opening it in freecad (I am creating/generating automatically document/objects in freecad and I would like also to automate the rendering part).
Hello!
I wanted to try the POV-Ray-Workbench in FreeCAD with a test figure, an example from FreeCAD called PartDesignExample.FCStd
in this case. I get the next output in the python console:
23:42:28 Path to *.pov File: ~/render/render.pov
1 parent objects found in highest layer
containing totally 16 objects
Your model contains 9 objects which aren't supported (will be represented as mesh).
Orthographic camera
23:43:53 PropertyPythonObject::toString(): failed for <class 'Lights.ViewProviderSpotLight'>
23:43:53 Traceback (most recent call last):
File "/usr/lib/python3.11/json/__init__.py", line 231, in dumps
return _default_encoder.encode(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/encoder.py", line 200, in encode
chunks = self.iterencode(o, _one_shot=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode
return _iterencode(o, 0)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
<class 'TypeError'>: Object of type SoGroup is not JSON serializable
I also get this error window which does not clarify anything further:
What I understand is that:
python 3.11.6 from Manjaro Linux
this timeIs there any way I can provider more information? Someway I could contribute more in this issue?
When I click on the camera icon to start the GUI, I get the following error:
12:04:08 Running the Python command 'Export' failed:
Traceback (most recent call last):
File "/home/zoltan/.FreeCAD/Mod/POV-Ray-Rendering/ExportCommand.py", line 41, in Activated
dialog = Dialog()
File "/home/zoltan/.FreeCAD/Mod/POV-Ray-Rendering/Dialog.py", line 47, in __init__
self.initUI()
File "/home/zoltan/.FreeCAD/Mod/POV-Ray-Rendering/Dialog.py", line 57, in initUI
self.textureTab = TextureTab()
File "/home/zoltan/.FreeCAD/Mod/POV-Ray-Rendering/Dialog.py", line 581, in __init__
self.initUIElements()
File "/home/zoltan/.FreeCAD/Mod/POV-Ray-Rendering/Dialog.py", line 592, in initUIElements
self.addObjectsTexturesLists() # add the two lists at the top
File "/home/zoltan/.FreeCAD/Mod/POV-Ray-Rendering/Dialog.py", line 617, in addObjectsTexturesLists
self.addTextureList()
File "/home/zoltan/.FreeCAD/Mod/POV-Ray-Rendering/Dialog.py", line 665, in addTextureList
categories = predefined.getchildren()
'xml.etree.ElementTree.Element' object has no attribute 'getchildren'
The FreeCAD version I use is
OS: Ubuntu 18.04.6 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 2021.615.24301 +3747 (Git) AppImage
Build type: Release
Branch: LinkDaily
Hash: ecbfba008c481db4cb17bf8bd514b2d12690a8e5
Python version: 3.9.4
Qt version: 5.12.9
Coin version: 4.0.1
OCC version: 7.5.2
Locale: English/United States (en_US)
Do you have any ideas what the problem could be?
File: LightPipe.pov Line: 37
File Context (5 lines):
polygon {
5, <-88.03699747721353, -66.02774810791016>, <-88.03699747721353,
66.02774810791016>, <88.03699747721353, 66.02774810791016>, <88.03699747721353,
-66.02774810791016>, <-88.03699747721353, -66.02774810791016>
pigment { finish
Parse Error: No matching } in 'pigment', finish found instead
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.