OpenSCAD AddOpenSCADElement/ja: Difference between revisions

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

{{Docnav
{{Docnav
|[[OpenSCAD_ExplodeGroup|Explode Group]]
|[[OpenSCAD_ExplodeGroup|Explode Group]]
Line 10: Line 11:


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
{{GuiCommand/jp|Name=OpenSCAD_AddOpenSCADElement|Name/jp=OpenSCAD_AddOpenSCADElement|Workbenches=[[OpenSCAD Module|OpenSCAD]]|MenuLocation=OpenSCAD -> Add OpenSCAD Element}}
{{GuiCommand/ja|Name=OpenSCAD_AddOpenSCADElement|Name/ja=OpenSCAD_AddOpenSCADElement|Workbenches=[[OpenSCAD Module|OpenSCAD]]|MenuLocation=OpenSCAD -> Add OpenSCAD Element}}
</div>
</div>

==Description==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 30: Line 33:
上記ではOpenSCADアイコンとしても知られる最初のサンプルをインクルードしています。
上記ではOpenSCADアイコンとしても知られる最初のサンプルをインクルードしています。
</div>
</div>

Libraries should be accessible as usual, whereas example can be reached as stated below.

{{Code|code=
{{Code|code=
include <../examples/example001.scad>;
include <../examples/example001.scad>;
}}
}}

<div class="mw-translate-fuzzy">
would include the first examples also known as the OpenSCAD icon
would include the first examples also known as the OpenSCAD icon
</div>

==Setup OpenSCAD within FreeCAD==


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 48: Line 59:
</div>
</div>


FreeCAD needs to be told where to find the OpenSCAD executable
FreeCAD needs to be told where to find the OpenSCAD executable:
* Switch to the [[Image:Workbench_OpenSCAD.svg|24px]] [[OpenSCAD_Workbench|OpenSCAD Workbench]] via {{MenuCommand|Menu View Workbench → OpenSCAD}}
* Switch to the [[Image:Workbench_OpenSCAD.svg|24px]] [[OpenSCAD_Workbench|OpenSCAD Workbench]] via {{MenuCommand|View → Workbench → OpenSCAD}}
* Open the preferences dialog {{MenuCommand|Menu
* Open the preferences dialog {{MenuCommand|Edit Preferences}}
→ Edit → Preferences}}
* Click on "OpenSCAD" on the left plane
* Click on "OpenSCAD" on the left plane
* Click on the button labled {{Button|...}} in {{MenuCommand|General Settings → General OpenSCAD Settings → OpenSCAD executable}} to browse the directory or enter the path (e.g. Ubuntu based Linux distributions {{incode|/usr/bin/openscad}}) directly into the line input right to the button
* Click on the button labled {{Button|...}} in {{MenuCommand|General Settings → General OpenSCAD Settings → OpenSCAD executable}} to browse the directory or enter the path (e.g. Ubuntu based Linux distributions {{incode|/usr/bin/openscad}}) directly into the line input right to the button
* Close and restart FreeCAD
* Close and restart FreeCAD
:'''Result:''' A new OpenSCAD icon will appear on the tool bar, and in the OpenSCAD menu, in the FreeCAD OpenSCAD workbench
: '''Result:''' A new OpenSCAD icon will appear on the tool bar, and in the OpenSCAD menu, in the FreeCAD OpenSCAD workbench.


Note: It is also possible to add another optional Parameter which controls the maximum sides of a polygon before it is considered a circle (fn).
Note: It is also possible to add another optional Parameter which controls the maximum sides of a polygon before it is considered a circle (fn).

Latest revision as of 11:06, 28 December 2022

OpenSCAD_AddOpenSCADElement

メニューの場所
OpenSCAD -> Add OpenSCAD Element
ワークベンチ
OpenSCAD
デフォルトのショートカット
None
バージョンで導入
-
も参照してください
None

Description

説明

タスクパネルにOpenSCADのコードを入力し、OpenSCADバイナリを実行することでOpenSCADのエレメントを追加します(OpenSCADが必要です)。

'as mesh'が選択されている場合、OpenSCADはメッシュをレンダリングします。

Addが押されるたびにOpenSCADのコードが実行されエレメントがインポートされます。

この機能はOpenSCADの出力で表示される以上の文法チェック、エラーは出力しません。 エレメントが見つからない場合はuse<>ステートメントやinclude<>ステートメントで指定したパスが間違っている可能性があります。

通常の場合と同様、ライブラリはアクセス可能でなければなりません。下記のように書くとサンプルにアクセス可能です。

include <../examples/example001.scad>;

上記ではOpenSCADアイコンとしても知られる最初のサンプルをインクルードしています。

Libraries should be accessible as usual, whereas example can be reached as stated below.

include <../examples/example001.scad>;

would include the first examples also known as the OpenSCAD icon

Setup OpenSCAD within FreeCAD

Initial set up from within FreeCAD

  • OpenSCAD needs to be installed on your computer before FreeCAD will have this functionality
    • install OpenSCAD in the appropriate manner for your operating system. See the OpenSCAD web site for more information
  • FreeCAD needs to be told where to find the OpenSCAD executable
    • Switch to the OpenSCAD Workbench Menu -> View Workbench -> OpenSCAD
    • Open the preferences dialog Menu -> Edit -> Preferences
    • Click on "OpenSCAD" on the left plane
    • Click on the button labled "..." in General Settings -> General OpenSCAD Settings -> OpenSCAD executable to browser the directory or enter the path (e.g. Ubuntu based Linux distributions /usr/bin/openscad) directly into the line input right to the button
    • close and restart FreeCAD, a new OpenSCAD icon will appear on the tool bar, and in the OpenSCAD menu, in the FreeCAD OpenSCAD workbench
  • It is also possible to add another optional Parameter which controls the maximum sides of a polygon before it is considered a circle (fn).

FreeCAD needs to be told where to find the OpenSCAD executable:

  • Switch to the OpenSCAD Workbench via View → Workbench → OpenSCAD
  • Open the preferences dialog Edit → Preferences
  • Click on "OpenSCAD" on the left plane
  • Click on the button labled ... in General Settings → General OpenSCAD Settings → OpenSCAD executable to browse the directory or enter the path (e.g. Ubuntu based Linux distributions /usr/bin/openscad) directly into the line input right to the button
  • Close and restart FreeCAD
Result: A new OpenSCAD icon will appear on the tool bar, and in the OpenSCAD menu, in the FreeCAD OpenSCAD workbench.

Note: It is also possible to add another optional Parameter which controls the maximum sides of a polygon before it is considered a circle (fn).

FreeCADバージョン0.14以降、上記の設定が空の場合、FreeCADはOpenSCAD実行可能ファイルを検索します。