May be you could handle crease angle only when exporting directly, giving the result a nicer view, and keep the standard method for the mesh object... what do you think?
Feature Request: 3D PDF Exporting to Asymptote format.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Re: Feature Request: 3D PDF Exporting to Asymptote format.
Re: Feature Request: 3D PDF Exporting to Asymptote format.
I have found a workaround to set crease angle for CAD models and even remove the invalid Normal node for mesh models
git commit 976867e71
git commit 976867e71
Re: Feature Request: 3D PDF Exporting to Asymptote format.
a code Master without limits Chapeau!wmayer wrote: ↑Tue Sep 08, 2020 12:37 pm I have found a workaround to set crease angle for CAD models and even remove the invalid Normal node for mesh models
git commit 976867e71
Re: Feature Request: 3D PDF Exporting to Asymptote format.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Feature Request: 3D PDF Exporting to Asymptote format.
Hi, yesterday I created the wiki Exporting meshes to Asymptote code
I have to say that this is my very first wiki I ever made.
So, for sure, it will have many aspects to be fixed.
I'll appreciate any feedback.
Regards.
I have uploaded many FreeCAD video tutorials to my YouTube channel
Re: Feature Request: 3D PDF Exporting to Asymptote format.
Hi Werner
I'm trying to export a shape to a mesh and then asy output using a python macro.
Here an example code:
Code: Select all
Gui.Selection.addSelection('Unnamed','Box')
Gui.activateWorkbench("MeshWorkbench")
Gui.getDocument('Unnamed').getObject('Box').ShapeColor=(0.61,0.96,0.07)
import MeshPartGui, FreeCADGui
# FreeCADGui.runCommand('MeshPart_Mesher')
import Mesh, Part, PartGui
import MeshPart
__doc__=FreeCAD.getDocument("Unnamed")
__mesh__=__doc__.addObject("Mesh::Feature","Mesh")
__part__=__doc__.getObject("Box")
__shape__=Part.getShape(__part__,"")
__mesh__.Mesh=MeshPart.meshFromShape(Shape=__shape__, LinearDeflection=0.1, AngularDeflection=0.523599, Relative=False,Segments=True)
__mesh__.Label="Cube (Meshed)"
del __doc__, __mesh__, __part__, __shape__
Gui.Selection.addSelection('Unnamed','Mesh')
Gui.runCommand('Mesh_Export',0)
Re: Feature Request: 3D PDF Exporting to Asymptote format.
Hi Maurice,
Only if your part has a uniform color you can apply it to the mesh:
Currently there is no easy way to do this via Python. In C++ the function highlightSegments() of the mesh view provider is invoked but this is not yet accessible via Python.
Only if your part has a uniform color you can apply it to the mesh:
Code: Select all
__mesh__.ViewObject.ShapeColor = __part__.ViewObject.ShapeColor
Re: Feature Request: 3D PDF Exporting to Asymptote format.
git commit e8b5cfced
Extend your script with:
Important is that the number of colors must match with the number of segments.
Extend your script with:
Code: Select all
__part__.ViewObject.DiffuseColor = [(1.,0.,0.), (0.,1.,0.), (0.,0.,1.), (1.,1.,0.), (1.,0.,1.), (0.,1.,1.)]
__mesh__.ViewObject.highlightSegments(__part__.ViewObject.DiffuseColor)
Re: Feature Request: 3D PDF Exporting to Asymptote format.
Fantastic!wmayer wrote: ↑Thu Sep 17, 2020 4:27 pm git commit e8b5cfced
Extend your script with:Important is that the number of colors must match with the number of segments.Code: Select all
__part__.ViewObject.DiffuseColor = [(1.,0.,0.), (0.,1.,0.), (0.,0.,1.), (1.,1.,0.), (1.,0.,1.), (0.,1.,1.)] __mesh__.ViewObject.highlightSegments(__part__.ViewObject.DiffuseColor)
Thx
Re: Feature Request: 3D PDF Exporting to Asymptote format.
Thx, I'll try it soon.jruiz wrote: ↑Thu Sep 17, 2020 1:40 pm Hi, yesterday I created the wiki Exporting meshes to Asymptote code
I have to say that this is my very first wiki I ever made.