Asymptote: Difference between revisions

From FreeCAD Documentation
(Still needs some work. Have added 'In progress'.)
(Removed translation tags.)
Line 7: Line 7:
<translate>
<translate>


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


<!--T:2-->
[https://asymptote.sourceforge.io/ Asymptote] is a programming language for the creation of 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.
[https://asymptote.sourceforge.io/ Asymptote] is a programming language for the creation of 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.


<!--T:3-->
Interactive 3D PDF files created from Asymptote code require Acrobat Reader version 9 or higher. For other PDF files any PDF reader can be used.
Interactive 3D PDF files created from Asymptote code require Acrobat Reader version 9 or higher. For other PDF files any PDF reader can be used.


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


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


<!--T:6-->
# 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_FaceColors.svg|16px]] [[Part_FaceColors|Part FaceColors]] command.
# Change to the [[Image:Workbench_Mesh.svg|16px]] [[Mesh Workbench|Mesh Workbench]].
# Change to the [[Image:Workbench_Mesh.svg|16px]] [[Mesh Workbench|Mesh Workbench]].
Line 30: Line 26:
# Press the {{Button|Save}} button.
# Press the {{Button|Save}} button.


==Converting to PDF== <!--T:7-->
==Converting==

===PDF===


<!--T:8-->
# Install the [https://sourceforge.net/projects/asymptote/ Asymptote compiler].
# Install the [https://sourceforge.net/projects/asymptote/ Asymptote compiler].
# Use this command line syntax to create the PDF file:{{Code|code=
# Use this command line syntax:{{Code|code=
asy -f pdf AsymptoteFileName.asy}}
asy -f pdf AsymptoteFileName.asy}}


===WebGL===
==Related== <!--T:9-->

# Install the [https://sourceforge.net/projects/asymptote/ Asymptote compiler].
# Use this command line syntax:{{Code|code=
asy -f html AsymptoteFileName.asy}}

==Related==


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


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


<!--T:12-->
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)]

Revision as of 10:03, 25 December 2020

Other languages:
This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Description

Asymptote is a programming language for the creation of 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. For other PDF files any PDF reader can be used.

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 FaceColors 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

PDF

  1. Install the Asymptote compiler.
  2. Use this command line syntax:
    asy -f pdf AsymptoteFileName.asy
    

WebGL

  1. Install the Asymptote compiler.
  2. Use this command line syntax:
    asy -f html AsymptoteFileName.asy
    

Related

Video tutorials

The following videos are in Spanish: