Asymptote: Difference between revisions

From FreeCAD Documentation
No edit summary
(Part_ColorPerFace)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{Page in progress}}
<translate>
<translate>


Line 7: Line 6:
<translate>
<translate>


==Description==
==Description== <!--T:13-->


<!--T:14-->
[https://asymptote.sourceforge.io/ Asymptote] is a vector language for 2D and 3D computer graphics. Asymptote code can be included in [https://www.latex-project.org/ LaTeX] documents or used to generate [https://en.wikipedia.org/wiki/PostScript PostScript], [[PDF]], [[SVG]], [https://www.khronos.org/webgl/ WebGL], and [https://en.wikipedia.org/wiki/PRC_(file_format) PRC] files. Interactive 3D PDF files created from Asymptote code require Acrobat Reader version 9 or higher.
[https://asymptote.sourceforge.io/ Asymptote] is a vector language for 2D and 3D computer graphics. Asymptote code can be included in [https://www.latex-project.org/ LaTeX] documents or used to generate [https://en.wikipedia.org/wiki/PostScript PostScript], [[PDF|PDF]], [[SVG|SVG]], [https://www.khronos.org/webgl/ WebGL], and [https://en.wikipedia.org/wiki/PRC_(file_format) PRC] files. Interactive 3D PDF files created from Asymptote code require Acrobat Reader version 9 or higher.


<!--T:15-->
Asymptote support was added in FreeCAD version 0.19.
Asymptote support was added in FreeCAD version 0.19.


==Exporting==
==Exporting== <!--T:16-->


<!--T:17-->
# Optionally assign colors to the faces of the object you want to export with the [[Image:Part_FaceColors.svg|16px]] [[Part_FaceColors|Part FaceColors]] command.
# Optionally assign colors to the faces of the object you want to export with the [[Image:Part_ColorPerFace.svg|24px]] [[Part_ColorPerFace|Part ColorPerFace]] command.
# Change to the [[Image:Workbench_Mesh.svg|16px]] [[Mesh Workbench|Mesh Workbench]].
# Create a mesh from the object with the [[Image:Mesh_FromPartShape.svg|16px]] [[Mesh_FromPartShape|Mesh FromPartShape]] command.
# Change to the [[Image:Workbench_Mesh.svg|24px]] [[Mesh Workbench|Mesh Workbench]].
# Create a mesh from the object with the [[Image:Mesh_FromPartShape.svg|24px]] [[Mesh_FromPartShape|Mesh FromPartShape]] command.
# Select the new mesh object.
# Select the new mesh object.
# Invoke the [[Image:Mesh_Export.svg|16px]] [[Mesh_Export|Mesh Export]] command.
# Invoke the [[Image:Mesh_Export.svg|24px]] [[Mesh_Export|Mesh Export]] command.
# Select the {{FileName|*.asy}} file format in the dialog box.
# Select the {{FileName|*.asy}} file format in the dialog box.
# Enter a filename.
# Enter a filename.
# Press the {{Button|Save}} button.
# Press the {{Button|Save}} button.


==Converting==
==Converting== <!--T:18-->


<!--T:19-->
You need the [https://sourceforge.net/projects/asymptote/ Asymptote compiler] to convert {{FileName|*.asy}} files. To convert to PDF a [https://www.latex-project.org/get/ LaTeX] system is also required. The compiler is a command line tool.
You need the [https://sourceforge.net/projects/asymptote/ Asymptote compiler] to convert {{FileName|*.asy}} files. To convert to PDF a [https://www.latex-project.org/get/ LaTeX] system is also required.


<!--T:20-->
* To covert to PDF you can use this syntax:{{Code|code=
The compiler is a command line tool. To covert to PDF you can use this syntax:
path-to-asy-executable/asy -f pdf AsymptoteFileName.asy}}
{{Code|code=PathToAsyExecutable/asy -f pdf AsymptoteFileName.asy}}
* To convert to WebGL you can use this syntax:{{Code|code=
path-to-asy-executable/asy -f html AsymptoteFileName.asy}}


==Related==
==Related== <!--T:21-->


<!--T:22-->
* [[Import_Export|Import Export]]
* [[Import_Export|Import Export]]
* [[FreeCAD_Howto_Import_Export|FreeCAD Howto Import Export]]


==Video tutorials==
==Video tutorials== <!--T:23-->


<!--T:24-->
The following videos are in Spanish:
The following videos are in Spanish:
* [https://www.youtube.com/watch?v=U0m3643Vb1Q A way of generating interactive pdf-3D files. (1/3) (From FreeCAD, MeshLab and LaTeX)]
* [https://www.youtube.com/watch?v=U0m3643Vb1Q A way of generating interactive pdf-3D files. (1/3) (From FreeCAD, MeshLab and LaTeX)]

Latest revision as of 18:20, 13 April 2024

Other languages:

Description

Asymptote is a vector language for 2D and 3D computer graphics. Asymptote code can be included in LaTeX documents or used to generate PostScript, PDF, SVG, WebGL, and PRC files. Interactive 3D PDF files created from Asymptote code require Acrobat Reader version 9 or higher.

Asymptote support was added in FreeCAD version 0.19.

Exporting

  1. Optionally assign colors to the faces of the object you want to export with the Part ColorPerFace command.
  2. Change to the Mesh Workbench.
  3. Create a mesh from the object with the Mesh FromPartShape command.
  4. Select the new mesh object.
  5. Invoke the Mesh Export command.
  6. Select the *.asy file format in the dialog box.
  7. Enter a filename.
  8. Press the Save button.

Converting

You need the Asymptote compiler to convert *.asy files. To convert to PDF a LaTeX system is also required.

The compiler is a command line tool. To covert to PDF you can use this syntax:

PathToAsyExecutable/asy -f pdf AsymptoteFileName.asy

Related

Video tutorials

The following videos are in Spanish: