Raytracing Workbench/ja: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>

{{Docnav
{{Docnav
|
|[[Points Workbench|Points Workbench]]
|
|[[Reverse Engineering Workbench|Reverse Engineering Workbench]]
|IconL=Workbench_Points.svg
|IconL=
|IconR=
|IconR=Workbench_Reverse_Engineering.svg
}}
}}


{{VeryImportantMessage|The '''Raytracing Workbench''' is no longer included after version 0.20.<br>
{{VeryImportantMessage|See the active development happening on the FreeCAD [https://github.com/FreeCAD/FreeCAD-render Render Workbench]}}
The external [https://github.com/FreeCAD/FreeCAD-render Render Workbench] should be used instead.}}


[[Image:Workbench_Raytracing.svg|thumb|128px|Raytracing workbench icon]]
[[Image:Workbench_Raytracing.svg|thumb|128px|Raytracing workbench icon]]


== Introduction ==
<div class="mw-translate-fuzzy">
このモジュールはシーンの内容を外部の[http://en.wikipedia.org/wiki/Rendering_(computer_graphics) レンダラー]に送り出し、作業物のフォトリアリスティックな画像を生成することを目標にしています。レイトレーシングモジュールはまだまだ未完成な初期段階にあり、今のところはそう多くの機能はありません。現在はパートオブジェクトを[http://en.wikipedia.org/wiki/POV-Ray POV-ray]ファイルとしてエクスポートするための基本的なツールのみ実装されています。エクスポートしたファイルはPOV-rayで読み込んでレンダリングすることができます。

=== GUIツール ===

{{Raytracing Tools/jp}}


=== ビューのエクスポート ===

もっとも簡単な方法は現在の3Dビューとその内容全てを[http://www.povray.org/ POV-ray]ファイルにエクスポートするというものです。まずCADデータを読み込むか作成するかし、適当な3D表示の位置に設定する必要があります。その後、Raytracingメニューから"Export View..."を選択します。

[[Image:FreeCAD_Raytracing.jpg|800px]]

結果*.povファイルの保存位置を尋ねられます。保存が終わると[http://www.povray.org/ POV-ray]でそれを開き、レンダリングすることができます。

[[Image:Povray.jpg]]

普段、レンダラーで行うのと同じように大きくてきれいな画像を作成できます:

[[Image:Scharniergreifer_render.jpg|800px]]

=== スクリプト処理 ===

モジュールの機能をPythonから使用する方法です:
import Raytracing,RaytracingGui
OutFile = open('C:/Documents and Settings/jriegel/Desktop/test.pov','w')
OutFile.write(open(App.getResourceDir()+'Mod/Raytracing/Templates/ProjectStd.pov').read())
OutFile.write(RaytracingGui.povViewCamera())
OutFile.write(Raytracing.getPartAsPovray('Box',App.activeDocument().Box.Shape,0.800000,0.800000,0.800000))
OutFile.close()
del OutFile
</div>


{{TOCright}}
{{TOCright}}


The [[Image:Workbench_Raytracing.svg|24px]] [[Raytracing Workbench|Raytracing Workbench]] is used to generate photorealistic images of your models by processing them with an external renderer.
The [[Image:Workbench_Raytracing.svg|24px]] [[Raytracing_Workbench|Raytracing Workbench]] is used to generate photorealistic images of your models by processing them with an external renderer.


The Raytracing Workbench works with [[Raytracing templates|templates]], which are project files that define a scene for your 3D model. You can place lights and geometry such as ground planes, and it also contains placeholders for the position of the camera, and for the material information of the objects in the scene. The project can then be exported to a ready-to-render file, or be rendered directly within FreeCAD.
The Raytracing Workbench works with [[Raytracing_templates|templates]], which are project files that define a scene for your 3D model. You can place lights and geometry such as ground planes, and it also contains placeholders for the position of the camera, and for the material information of the objects in the scene. The project can then be exported to a ready-to-render file, or be rendered directly within FreeCAD.


Currently, two renderers are supported: [http://en.wikipedia.org/wiki/POV-Ray povray] and [http://en.wikipedia.org/wiki/LuxRender luxrender]. To be able to render from within FreeCAD, at least one of these programs must be installed and configured in your system. However, if no renderer is installed, you will still be able to export a project file to be rendered at another time.
Currently, two renderers are supported: [[POV-Ray|POV-Ray]] and [[LuxRender|LuxRender]]. To be able to render from within FreeCAD, at least one of these programs must be installed and configured in your system. However, if no renderer is installed, you will still be able to export a project file to be rendered at another time.


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
The Raytracing workbench is essentially obsolete. New development is happening in the [https://github.com/FreeCAD/FreeCAD-render Render Workbench], which is intended as its replacement. This workbench is fully programmed in Python so it is much easier to extend than the current workbench which is programmed in C++. Nevertheless, the information in this page is generally useful for the new workbench, as both modules work basically in the same way.
----
現在、Lux RendererやYafarayなどの複数のバックエンドをサポートするための新しいRenderer Workbenchが開発中です。開発版を使用するための情報は[[Render_project]]で見ることができます。
</div>
</div>


Line 61: Line 30:


== Typical workflow ==
== Typical workflow ==
# Create or open a FreeCAD project, add some solid objects ([[Part Module|Part-based]] or [[PartDesign Workbench|PartDesign-based]]); meshes are currently not supported.
# Create or open a FreeCAD project, add some solid objects ([[Part_Workbench|Part-based]] or [[PartDesign_Workbench|PartDesign-based]]); meshes are currently not supported.
# Create a Raytracing project (povray or luxrender).
# Create a Raytracing project (povray or luxrender).
# Select the objects that you wish to add to the Raytracing project and add them.
# Select the objects that you wish to add to the Raytracing project and add them.
Line 72: Line 41:
{{Caption|Workflow of the Raytracing Workbench; the workbench prepares a project file from a given template, and then calls an external program to produce the actual rendering of the scene. The external renderer can be used independently of FreeCAD.}}
{{Caption|Workflow of the Raytracing Workbench; the workbench prepares a project file from a given template, and then calls an external program to produce the actual rendering of the scene. The external renderer can be used independently of FreeCAD.}}


<span id="Tools"></span>
==構築用ツール==
==構築用ツール==


Line 77: Line 47:


These are the main tools for exporting your 3D work to external renderers.
These are the main tools for exporting your 3D work to external renderers.
* [[Image:Raytrace_New.svg|32px]] [[Raytracing_New|New PovRay project]]: Insert new PovRay project in the document
* [[Image:Raytracing_New.svg|32px]] [[Raytracing_New|New PovRay project]]: Insert new PovRay project in the document
* [[Image:Raytrace_Lux.svg|32px]] [[Raytracing_Lux|New LuxRender project]]: Insert new LuxRender project in the document
* [[Image:Raytracing_Lux.svg|32px]] [[Raytracing_Lux|New LuxRender project]]: Insert new LuxRender project in the document
* [[Image:Raytrace_NewPartSegment.svg|32px]] [[Raytracing_InsertPart|Insert part]]: Insert a view of a Part in a raytracing project
* [[Image:Raytracing_InsertPart.svg|32px]] [[Raytracing_InsertPart|Insert part]]: Insert a view of a Part in a raytracing project
* [[Image:Raytrace_ResetCamera.svg|32px]] [[Raytracing_ResetCamera|Reset camera]]: Matches the camera position of a raytracing project to the current view
* [[Image:Raytracing_ResetCamera.svg|32px]] [[Raytracing_ResetCamera|Reset camera]]: Matches the camera position of a raytracing project to the current view
* [[Image:Raytrace_ExportProject.svg|32px]] [[Raytracing_ExportProject|Export project]]: Exports a raytracing project to a scene file for rendering in an external renderer
* [[Image:Raytracing_ExportProject.svg|32px]] [[Raytracing_ExportProject|Export project]]: Exports a raytracing project to a scene file for rendering in an external renderer
* [[Image:Raytrace_Render.svg|32px]] [[Raytracing_Render|Render]]: Renders a raytracing project with an external renderer
* [[Image:Raytracing_Render.svg|32px]] [[Raytracing_Render|Render]]: Renders a raytracing project with an external renderer


===Utilities===
===Utilities===


These are helper tools to perform specific tasks manually.
These are helper tools to perform specific tasks manually.
* [[Image:Raytrace_Export.svg|32px]] [[Raytracing_Export|Export view to povray]]: Write the active 3D view with camera and all its content to a povray file
* [[Image:Raytracing_WriteView.svg|32px]] [[Raytracing_WriteView|Export view to povray]]: Write the active 3D view with camera and all its content to a povray file
* [[Image:Raytrace_Camera.svg|32px]] [[Raytracing_Camera|Export camera to povray]]: Export the camera position of the active 3D view in POV-Ray format to a file
* [[Image:Raytracing_WriteCamera.svg|32px]] [[Raytracing_WriteCamera|Export camera to povray]]: Export the camera position of the active 3D view in POV-Ray format to a file
* [[Image:Raytrace_Part.svg|32px]] [[Raytracing_Part|Export part to povray]]: Write the selected Part (object) as a povray file
* [[Image:Raytracing_WritePart.svg|32px]] [[Raytracing_WritePart|Export part to povray]]: Write the selected Part (object) as a povray file


== Preferences ==
== Preferences ==
Line 110: Line 80:
[[Image:Scharniergreifer_render.jpg|center|800px]]
[[Image:Scharniergreifer_render.jpg|center|800px]]


<span id="Scripting"></span>
== スクリプト処理 ==
== スクリプト処理 ==


See the [[Raytracing API example|Raytracing API example]] for information on writing scenes programmatically.
See the [[Raytracing API example|Raytracing API example]] for information on writing scenes programmatically.


<span id="Links"></span>
== リンク ==
== リンク ==


Line 121: Line 93:
* http://en.wikipedia.org/wiki/POV-Ray
* http://en.wikipedia.org/wiki/POV-Ray


=== LuxRender ===
----
* [[LuxRender|LuxRender page on this wiki]]
現在、LuxRendererやYafarayといった複数のバックエンドをサポートするために新しくレンダラーワークベンチが開発中です。開発版を使用するための情報は[[Render_project|レンダラープロジェクト]]で見ることができます。
* http://www.luxrender.net/

レンダラーモジュールの開発ステータスについては[[Raytracing_project/jp|レイトレーシングプロジェクト]] を見てください。


===オープンソースのレンダラー(将来的に実装予定)===
===オープンソースのレンダラー(将来的に実装予定)===
Line 148: Line 119:
* if importing multiple objects in Kerkythea you can use the "File → Merge" command in Kerkythea
* if importing multiple objects in Kerkythea you can use the "File → Merge" command in Kerkythea


==Development==
<div class="mw-translate-fuzzy">

==リンク==
These pages refer to the new workbench, programmed in Python, meant to replace the current Raytracing Workbench.
* [[Render_project|Render project]]
* [https://github.com/FreeCAD/FreeCAD-render Render Workbench]
* [[Raytracing_tutorial|Raytracing tutorial]]
* [https://forum.freecadweb.org/viewtopic.php?f=9&t=25933 Render Workbench] (announcement only, no discussion)
</div>
* [https://forum.freecadweb.org/viewtopic.php?t=39168 FreeCAD Renderer Workbench improvements]



<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
{{docnav|Drawing Module|Image Module}}
{{docnav|Drawing Workbench|Image Workbench}}
</div>
</div>


{{Raytracing Tools navi{{#translation:}}}}
{{Raytracing Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
[[Category:Workbenches{{#translation:}}]]
[[Category:Obsolete Workbenches{{#translation:}}]]

Latest revision as of 16:17, 3 May 2023

The Raytracing Workbench is no longer included after version 0.20.
The external Render Workbench should be used instead.
Raytracing workbench icon

Introduction

The Raytracing Workbench is used to generate photorealistic images of your models by processing them with an external renderer.

The Raytracing Workbench works with templates, which are project files that define a scene for your 3D model. You can place lights and geometry such as ground planes, and it also contains placeholders for the position of the camera, and for the material information of the objects in the scene. The project can then be exported to a ready-to-render file, or be rendered directly within FreeCAD.

Currently, two renderers are supported: POV-Ray and LuxRender. To be able to render from within FreeCAD, at least one of these programs must be installed and configured in your system. However, if no renderer is installed, you will still be able to export a project file to be rendered at another time.

The Raytracing workbench is essentially obsolete. New development is happening in the Render Workbench, which is intended as its replacement. This workbench is fully programmed in Python so it is much easier to extend than the current workbench which is programmed in C++. Nevertheless, the information in this page is generally useful for the new workbench, as both modules work basically in the same way.

Typical workflow

  1. Create or open a FreeCAD project, add some solid objects (Part-based or PartDesign-based); meshes are currently not supported.
  2. Create a Raytracing project (povray or luxrender).
  3. Select the objects that you wish to add to the Raytracing project and add them.
  4. Export the project file or render it directly.



Workflow of the Raytracing Workbench; the workbench prepares a project file from a given template, and then calls an external program to produce the actual rendering of the scene. The external renderer can be used independently of FreeCAD.

構築用ツール

Project tools

These are the main tools for exporting your 3D work to external renderers.

  • New PovRay project: Insert new PovRay project in the document
  • New LuxRender project: Insert new LuxRender project in the document
  • Insert part: Insert a view of a Part in a raytracing project
  • Reset camera: Matches the camera position of a raytracing project to the current view
  • Export project: Exports a raytracing project to a scene file for rendering in an external renderer
  • Render: Renders a raytracing project with an external renderer

Utilities

These are helper tools to perform specific tasks manually.

Preferences

  • Preferences: Preferences available in for the Raytracing tools.

Tutorials

Creating a povray file manually

The utility tools described above allow you to export the current 3D view and all of its content to a Povray file. First, you must load or create your CAD data and position the 3D View orientation as you wish. Then choose "Utilities → Export View..." from the raytracing menu.

You will be asked for a location to save the resulting *.pov file. After that you can open it in Povray and render:

As usual in a renderer you can make big and nice pictures:

スクリプト処理

See the Raytracing API example for information on writing scenes programmatically.

リンク

POV-Rayについて:

LuxRender

オープンソースのレンダラー(将来的に実装予定)

Exporting to Kerkythea

Although direct export to the Kerkythea XML-File-Format is not supported yet, you can export your Objects as Mesh-Files (.obj) and then import them in Kerkythea.

  • if using Kerkythea for Linux, remember to install the WINE-Package (needed by Kerkythea for Linux to run)
  • you can convert your models with the help of the mesh workbench to meshes and then export these meshes as .obj-files
  • If your mesh-export resulted in errors (flip of normals, holes ...) you may try your luck with netfabb studio basic
Free for personal use, available for Windows, Linux and Mac OSX.
It has standard repair tools which will repair you model in most cases.
  • another good program for mesh analysing/repairing is Meshlab
Open Source, available for Windows, Linux and Mac OSX.
It has standard repair tools which will repair you model in most cases (fill holes, re-orient normals, etc.)
  • you can use "make compound" and then "make single copy" or you can fuse solids to group them before converting to meshes
  • remember to set in Kerkythea an import-factor of 0.001 for obj-modeler, since Kerkythea expects the obj-file to be in m (but standard units-scheme in FreeCAD is mm)
Within WIndows 7 64-bit Kerkythea does not seem to be able to save these settings.
So remember to do that each time you start Kerkythea
  • if importing multiple objects in Kerkythea you can use the "File → Merge" command in Kerkythea

Development

These pages refer to the new workbench, programmed in Python, meant to replace the current Raytracing Workbench.


Drawing Workbench
Image Workbench