Kerkythea Rendering System

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
marmni
Posts: 44
Joined: Sat Nov 30, 2013 3:53 pm

Kerkythea Rendering System

Postby marmni » Sun Dec 14, 2014 9:56 pm

Hi,
I started work on exporter for Kerkythea Rendering System. Script in attachment is a first version so not everything is implemented yet (but it works correctly :)). Script gets colours from DiffuseColor, and groups models by used color - to reduce models (at this moment - in future there will be also possible to export each face as new model).

To do:
- add lights/cameras
- add save as window
- remove duplicate points from list
- add support for textures (for future :))
- rewrite some code parts
- maybe some settings tab for export?

I tried to connect this script with Raytracking workbench (as new toolbar) but I was unable to do this, that's why I upload it as macro.

At this moment xml file is saved in main FreeCAD folder (textNowy.xml) - temporary solution (see to do list ;)).
I think that most of new features will appear in next few days.

Some first results (without extra settings):
2014-12-14 21_57_27-FreeCAD.png
2014-12-14 21_57_27-FreeCAD.png (365.48 KiB) Viewed 2960 times
aa2.jpg
aa2.jpg (140.04 KiB) Viewed 2960 times
Attachments
exportToKerkythea.7z
(2.58 KiB) Downloaded 52 times
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Kerkythea Rendering System

Postby NormandC » Sun Dec 14, 2014 11:30 pm

Hello marmni,

Your work looks cool, but the "Feature Announcements" forum is for official FreeCAD features. Accordingly I moved your topic to the Open discussion forum.

Please also consider publishing your work on a platform like GitHub or BitBucket where the code can be reviewed without having to download it.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Kerkythea Rendering System

Postby NormandC » Sun Dec 14, 2014 11:32 pm

Well looking at your posting history I noticed that Yorik at some point posted himself about your EaglePCB Importer in the Feature Annoucements forum... :?
User avatar
r-frank
Posts: 2181
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Kerkythea Rendering System

Postby r-frank » Mon Dec 15, 2014 7:57 am

Hello marmni.

Thanks for this gem ...

During the last few weeks i modelled some assemblies because
I wanted to spend some time in Winter holidays on Raytracing
with Kerkythea.

My first aim would have been to export via OBJ and then append
the files in Kerkythea.
But since you provide this macro I will also have a look at this and
test it.

Personally I would prefer handing over ONLY THE GEOMETRY.
Having to define one time per setting (in the macro itself, like in Yorik's
Part Library Browser) or in a "save as" Dialog the Name and place of the
XML-File would both be acceptable for me.

I would prefer it it would be possible to have Export Options like:
> all at the moment in 3D view visible solids as sepearate Solids
> all at the moment in 3D view visible solids as one single solid
> Export of selectable solids
> Export by Face

But this is just my personal opinion.

If this is OK with you, I would put the macro with some description on the macros recipes-page
on the wiki after you finished your improvements ...

Anyway thanks for spending time on this improvement.

Roland
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
User avatar
yorik
Site Admin
Posts: 11712
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Kerkythea Rendering System

Postby yorik » Mon Dec 15, 2014 2:21 pm

Very cool! Kerkythea is a bit old already but I'm still pretty fond of it... It is a very nice renderer, and with a bit of tweaking it can produce wonderful lighting.

About the topic location, for me wherever is fine, open discussion or feature announcement :) Maybe while it's not finished, it's indeed better here.

I would also vote for a file saving dialog on export. That's what most apps would do. You can do that with one single line of python code, with pyside, using PySide.QtGui.QFileDialog.getSaveFileName()
User avatar
r-frank
Posts: 2181
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Kerkythea Rendering System

Postby r-frank » Mon Dec 15, 2014 6:20 pm

Sorry to report, but first test already failed.

Tested with
FreeCAD 015.4250 on Windows 7 64 bit (SGROGAN Build)
FreeCAD 015.4276 in Linux Mint 13 (daily PPA).

Both with same results.
Old_Car is small "Assembly" done with Part Module Workbench.
Axle is inserted three times, Tires are Ignored.
Everything exported as ONE Object, not desired ...

Look at FreeCAD File, Picture attached.
Look at Kerkythea Result.

Tested with Kerkythea 200 Echo V2.0.19.

Do you have to mark your Solids for Export in Tree View ? ... I didn't do that ...

Roland
Attachments
Old_Car.jpg
Old_Car.jpg (35.06 KiB) Viewed 2806 times
Old_Car-FreeCAD.jpeg
Old_Car-FreeCAD.jpeg (40.05 KiB) Viewed 2806 times
Old_Car.FCStd
(115.41 KiB) Downloaded 34 times
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
marmni
Posts: 44
Joined: Sat Nov 30, 2013 3:53 pm

Re: Kerkythea Rendering System

Postby marmni » Mon Dec 15, 2014 8:44 pm

Hi,
Thanks for Your feedback. There was a bug in script with missing 'Enter' characters :).
car.jpg
car.jpg (49.47 KiB) Viewed 2778 times
https://github.com/marmni/FreeCAD-Kerkythea
User avatar
r-frank
Posts: 2181
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Kerkythea Rendering System

Postby r-frank » Mon Dec 15, 2014 9:46 pm

Wow!

Yes, this works now. Thanks.

1) At the moment it is not possible to switch "Group models by color" to "No"
2) Export selected faces does not work (yet)
3) Being asked for a specific directory and filename would be awesome !

Side Obervation:
The Name of the Objects Kerkythea imports seem to be generated randomly ?
(Just an observation ...)
If you don't group by colors and export visible or selected solids it would be way cool
to have Kerkythea show the names derived from FreeCAD.
But that would be the dot on the "i" ...

Anyway two thumbs up.
Many thanks for sharing.

Roland
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
marmni
Posts: 44
Joined: Sat Nov 30, 2013 3:53 pm

Re: Kerkythea Rendering System

Postby marmni » Mon Dec 15, 2014 10:52 pm

The Name of the Objects Kerkythea imports seem to be generated randomly ?
(Just an observation ...)
Yes, in mode - Group by colors.
If you don't group by colors and export visible or selected solids it would be way cool
to have Kerkythea show the names derived from FreeCAD.
Done.
User avatar
r-frank
Posts: 2181
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Kerkythea Rendering System

Postby r-frank » Mon Jan 19, 2015 8:40 pm

Hello marmni.

I just realised that you added the "File > Save as" dialogue.
Good job.

If you don't mind I would like to mention the macro on the macro recipes page (with link to your Github account).
If I have more time I would also like to enhance the corresponding pages of the wiki (Raytracing workbench).

I just noticed something.
Could there be the scale-problem as Stephen mentions here on Vimeo ?

My model seems to be way too big (in Kerkythea).

Roland
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)