I hope the following could help:
- On p134 of Asymptote: the Vector GraphicsLanguage they describe what they call material.
- Also on p 89 of An Asymptote tutorial there is another brief explanation.
I hope the following could help:
Great!wmayer wrote: ↑Thu Aug 27, 2020 10:56 amWith git commit 50bbd522 and git commit 58a92681 it's now possible to also export colored meshes. They can be colored by face or by vertex.
Yes. Werner modified C++ code, so you can only get the new functionality if you recompile the entire source code with these additions.jruiz wrote: ↑Thu Aug 27, 2020 1:24 pm...
Does the entire FreeCAD source have to be downloaded, then four files in[git commit 4badaba52] be substituted and then compile the FreeCAD source?
Gonna try to compile it. Wanna see FreeCAD exporting to Asymptote.vocx wrote: ↑Thu Aug 27, 2020 2:14 pmYes. Werner modified C++ code, so you can only get the new functionality if you recompile the entire source code with these additions.jruiz wrote: ↑Thu Aug 27, 2020 1:24 pm...
Does the entire FreeCAD source have to be downloaded, then four files in[git commit 4badaba52] be substituted and then compile the FreeCAD source?
This is not a very complicated procedure if you know what you are doing. But if you don't want to compile, then you can wait a day for the Ubuntu daily package to be generated; or wait a week, for the new AppImage, Windows and MacOS packages to be generated. Then you can test the new functionality there.
Compiling
Code: Select all
/*
* Created by FreeCAD <http://www.freecadweb.org>
*/
import three;
size(500);
// CA:Camera, OB:Camera
currentprojection = orthographic(camera = (15, 5, 5),
target = (5, 5, 5),
showtarget = false,
up = (0, 0, 1));
// ME:Mesh, OB:Mesh
draw(surface((0, 10, 0)--(0, 0, 10)--(0, 10, 10)--cycle),
rgb(1, 0.666667, 0));
draw(surface((0, 0, 0)--(0, 0, 10)--(0, 10, 0)--cycle),
rgb(1, 0.666667, 0));
draw(surface((10, 0, 10)--(10, 10, 0)--(10, 10, 10)--cycle),
rgb(0, 0, 1));
draw(surface((10, 0, 10)--(10, 0, 0)--(10, 10, 0)--cycle),
rgb(0, 0, 1));
draw(surface((10, 0, 0)--(10, 0, 10)--(0, 0, 0)--cycle),
rgb(0, 1, 0));
draw(surface((0, 0, 0)--(10, 0, 10)--(0, 0, 10)--cycle),
rgb(0, 1, 0));
draw(surface((10, 10, 10)--(10, 10, 0)--(0, 10, 0)--cycle),
rgb(0, 0.666667, 1));
draw(surface((10, 10, 10)--(0, 10, 0)--(0, 10, 10)--cycle),
rgb(0, 0.666667, 1));
draw(surface((0, 10, 0)--(10, 10, 0)--(0, 0, 0)--cycle),
rgb(0.333333, 0.666667, 0));
draw(surface((0, 0, 0)--(10, 10, 0)--(10, 0, 0)--cycle),
rgb(0.333333, 0.666667, 0));
draw(surface((10, 10, 10)--(0, 10, 10)--(0, 0, 10)--cycle),
rgb(1, 0, 0));
draw(surface((10, 10, 10)--(0, 0, 10)--(10, 0, 10)--cycle),
rgb(1, 0, 0));
Cool!wmayer wrote: ↑Thu Aug 27, 2020 3:13 pmHere is the content of a simple cube where the six sides have different colors:Save it as cube.asy.Code: Select all
/* * Created by FreeCAD <http://www.freecadweb.org> */ import three; size(500); // CA:Camera, OB:Camera currentprojection = orthographic(camera = (15, 5, 5), target = (5, 5, 5), showtarget = false, up = (0, 0, 1)); // ME:Mesh, OB:Mesh draw(surface((0, 10, 0)--(0, 0, 10)--(0, 10, 10)--cycle), rgb(1, 0.666667, 0)); draw(surface((0, 0, 0)--(0, 0, 10)--(0, 10, 0)--cycle), rgb(1, 0.666667, 0)); draw(surface((10, 0, 10)--(10, 10, 0)--(10, 10, 10)--cycle), rgb(0, 0, 1)); draw(surface((10, 0, 10)--(10, 0, 0)--(10, 10, 0)--cycle), rgb(0, 0, 1)); draw(surface((10, 0, 0)--(10, 0, 10)--(0, 0, 0)--cycle), rgb(0, 1, 0)); draw(surface((0, 0, 0)--(10, 0, 10)--(0, 0, 10)--cycle), rgb(0, 1, 0)); draw(surface((10, 10, 10)--(10, 10, 0)--(0, 10, 0)--cycle), rgb(0, 0.666667, 1)); draw(surface((10, 10, 10)--(0, 10, 0)--(0, 10, 10)--cycle), rgb(0, 0.666667, 1)); draw(surface((0, 10, 0)--(10, 10, 0)--(0, 0, 0)--cycle), rgb(0.333333, 0.666667, 0)); draw(surface((0, 0, 0)--(10, 10, 0)--(10, 0, 0)--cycle), rgb(0.333333, 0.666667, 0)); draw(surface((10, 10, 10)--(0, 10, 10)--(0, 0, 10)--cycle), rgb(1, 0, 0)); draw(surface((10, 10, 10)--(0, 0, 10)--(10, 0, 10)--cycle), rgb(1, 0, 0));
To render the content: asy -V cube.asy
To create a PDF file: asy -f pdf cube.asy -o cube.pdf
I have to congratulate you. You made an excellent job in a very short time.wmayer wrote: ↑Thu Aug 27, 2020 3:13 pmHere is the content of a simple cube where the six sides have different colors:Save it as cube.asy.Code: Select all
/* * Created by FreeCAD <http://www.freecadweb.org> */ import three; size(500); // CA:Camera, OB:Camera currentprojection = orthographic(camera = (15, 5, 5), target = (5, 5, 5), showtarget = false, up = (0, 0, 1)); // ME:Mesh, OB:Mesh draw(surface((0, 10, 0)--(0, 0, 10)--(0, 10, 10)--cycle), rgb(1, 0.666667, 0)); draw(surface((0, 0, 0)--(0, 0, 10)--(0, 10, 0)--cycle), rgb(1, 0.666667, 0)); draw(surface((10, 0, 10)--(10, 10, 0)--(10, 10, 10)--cycle), rgb(0, 0, 1)); draw(surface((10, 0, 10)--(10, 0, 0)--(10, 10, 0)--cycle), rgb(0, 0, 1)); draw(surface((10, 0, 0)--(10, 0, 10)--(0, 0, 0)--cycle), rgb(0, 1, 0)); draw(surface((0, 0, 0)--(10, 0, 10)--(0, 0, 10)--cycle), rgb(0, 1, 0)); draw(surface((10, 10, 10)--(10, 10, 0)--(0, 10, 0)--cycle), rgb(0, 0.666667, 1)); draw(surface((10, 10, 10)--(0, 10, 0)--(0, 10, 10)--cycle), rgb(0, 0.666667, 1)); draw(surface((0, 10, 0)--(10, 10, 0)--(0, 0, 0)--cycle), rgb(0.333333, 0.666667, 0)); draw(surface((0, 0, 0)--(10, 10, 0)--(10, 0, 0)--cycle), rgb(0.333333, 0.666667, 0)); draw(surface((10, 10, 10)--(0, 10, 10)--(0, 0, 10)--cycle), rgb(1, 0, 0)); draw(surface((10, 10, 10)--(0, 0, 10)--(10, 0, 10)--cycle), rgb(1, 0, 0));
To render the content: asy -V cube.asy
To create a PDF file: asy -f pdf cube.asy -o cube.pdf
Users browsing this forum: No registered users and 4 guests