Code Monkey home page Code Monkey logo

freecad-povray-render's People

Contributors

luzpaz avatar theraytracers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

luzpaz

freecad-povray-render's Issues

Rendering extra details

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?

scriptability of the povray workbench

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).

Which are the supported object types?

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:
Screenshot_20240211_232955

What I understand is that:

  1. The object is not supported and there is some kind of default object
  2. There is an exception/error in the python library(?). I'm working with python 3.11.6 from Manjaro Linux this time

Is there any way I can provider more information? Someway I could contribute more in this issue?

Cannot start the GUI

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?

Issue with a Missing Bracket for pigment

image

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.