OpenSCAD Workbench/es: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
<languages/>
<languages/>
{{Docnav
{{docnav|[[Mesh Module|Mesh Module]]|[[Part Module|Part Module]]|IconL=Workbench_Mesh.svg|IconR=Workbench_Part.svg}}
|[[Mesh Module|Mesh Module]]
|[[Part Module|Part Module]]
|IconL=Workbench_Mesh.svg
|IconR=Workbench_Part.svg
}}


[[Image:OpenSCADWorkbench.svg|64px]]
[[Image:Workbench_OpenSCAD.svg|thumb|128px|OpenSCAD workbench icon]]


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
El módulo OpenSCAD está en un estado de desarrollo inicial.
El módulo OpenSCAD está en un estado de desarrollo inicial.
</div>
</div>

The [[Image:Workbench_OpenSCAD.svg|24px]] [[OpenSCAD Workbench]] is intended to offer interoperability with the open source software [http://www.openscad.org/ OpenSCAD]. This program is not distributed as part of FreeCAD, but should be installed to make full use of this workbench.


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 12: Line 19:
</div>
</div>


This workbench contains functions to modify the CSG feature tree and repair models. It also contains general purpose tools that do not require installation of OpenSCAD; they can be used in conjunction with other workbenches.
This workbench contains functions to modify the CSG feature tree and repair models. It also contains general purpose tools that do not require installation of OpenSCAD; they can be used in conjunction with other workbenches. For example, the [[Mesh_Workbench|Mesh Workbench]] internally uses the OpenSCAD functions to perform operations with [[mesh|meshes]], as they are quite robust.


{{TOCright}}
{{TOCright}}
[[Image:OpenSCADexamaple1.png]]
[[Image:OpenSCADexamaple1.png]]

== Dependencies ==

In FreeCAD 0.19, the Ply (Python-Lex-Yacc) module, which is used to import CSG files, was removed from the FreeCAD source code, as it is a third party library not developed by FreeCAD. As a result, you now need to install Ply before using the OpenSCAD Workbench. When using a pre-packaged, stable version of FreeCAD this dependency should be installed automatically in all platforms; in other cases, for example, when [[Compiling|compiling]] from source, you may have to install it from an online repository.

In Debian/Ubuntu based systems this is done like this.
{{Code|code=
sudo apt install python3-ply
}}

The general installation in all platforms can be done from the Python package index.
{{Code|code=
pip3 install --user ply
}}


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 50: Line 71:
</div>
</div>


* [[Image:OpenSCAD_ColorCodeShape.png|32px]] [[OpenSCAD_ColorCodeShape|Color Code Shape]]: Change the color of selected or all shapes based on their validity.
* [[Image:OpenSCAD_ColorCodeShape.svg|32px]] [[OpenSCAD_ColorCodeShape|Color Code Shape]]: Change the color of selected or all shapes based on their validity.
* [[Image:OpenSCAD_ReplaceObject.png|32px]] [[OpenSCAD_ReplaceObject|Replace Object]]: Replace an object in the feature tree.
* [[Image:OpenSCAD_ReplaceObject.svg|32px]] [[OpenSCAD_ReplaceObject|Replace Object]]: Replace an object in the feature tree.
* [[Image:OpenSCAD_RemoveSubtree.png|32px]] [[OpenSCAD_RemoveSubtree|Remove Subtree]]: Removes the selected objects and all children that are not referenced from other objects.
* [[Image:OpenSCAD_RemoveSubtree.svg|32px]] [[OpenSCAD_RemoveSubtree|Remove Subtree]]: Removes the selected objects and all children that are not referenced from other objects.
* [[Image:OpenSCAD_RefineShapeFeature.png|32px]] [[OpenSCAD_RefineShapeFeature|Refine Shape Feature]]: Create Refine Shape Feature.
* [[Image:OpenSCAD_RefineShapeFeature.svg|32px]] [[OpenSCAD_RefineShapeFeature|Refine Shape Feature]]: Create Refine Shape Feature.
* [[Image:OpenSCAD_IncreaseTolerance.png|32px]] [[OpenSCAD_IncreaseTolerance|Increase Tolerance Feature]]: Increases tolerance of edges/faces/vertex of selected object(s).
* [[Image:OpenSCAD_IncreaseToleranceFeature.svg|32px]] [[OpenSCAD_IncreaseTolerance|Increase Tolerance Feature]]: Increases tolerance of edges/faces/vertex of selected object(s).
* [[Image:OpenSCAD_Edgestofaces.png|32px]] [[OpenSCAD_Edgestofaces|Convert Edges To Faces]]: Convert edges to faces. Useful to prepare imported DXF geometry for extrusion.
* [[Image:OpenSCAD_Edgestofaces.png|32px]] [[OpenSCAD_Edgestofaces|Convert Edges To Faces]]: Convert edges to faces. Useful to prepare imported DXF geometry for extrusion.
* [[Image:OpenSCAD_ExpandPlacements.png|32px]] [[OpenSCAD_ExpandPlacements|Expand Placements]]: Expand all placements downwards the FeatureTree.
* [[Image:OpenSCAD_ExpandPlacements.png|32px]] [[OpenSCAD_ExpandPlacements|Expand Placements]]: Expand all placements downwards the FeatureTree.
Line 60: Line 81:
* [[Image:OpenSCAD_AddOpenSCADElement.png|32px]] [[OpenSCAD_AddOpenSCADElement|Add OpenSCAD Element]]: Add an OpenSCAD element by entering OpenSCAD code into the task panel.
* [[Image:OpenSCAD_AddOpenSCADElement.png|32px]] [[OpenSCAD_AddOpenSCADElement|Add OpenSCAD Element]]: Add an OpenSCAD element by entering OpenSCAD code into the task panel.
* [[Image:OpenSCAD_MeshBoolean.png|32px]] [[OpenSCAD_MeshBoolean|Mesh Boolean]]: Creates new mesh object by boolean operation from shapes.
* [[Image:OpenSCAD_MeshBoolean.png|32px]] [[OpenSCAD_MeshBoolean|Mesh Boolean]]: Creates new mesh object by boolean operation from shapes.
* [[Image:OpenSCAD_Hull.png|32px]] [[OpenSCAD_Hull|Hull]]: Applies a hull to selected shapes.
* [[Image:OpenSCAD_Hull.svg|32px]] [[OpenSCAD_Hull|Hull]]: Applies a hull to selected shapes.
* [[Image:OpenSCAD_Minkowski.png|32px]] [[OpenSCAD_Minkowski|Minkowski]]: Applies a minkowski sum to selected shapes.
* [[Image:OpenSCAD_Minkowski.svg|32px]] [[OpenSCAD_Minkowski|Minkowski]]: Applies a minkowski sum to selected shapes.


== Preferences ==
== Preferences ==


* [[Image:Std_DlgParameter.png|32px]] [[OpenSCAD_Preferences|Preferences]]: preferences available for the OpenSCAD tools.
* [[Image:Std_DlgParameter.svg|32px]] [[OpenSCAD_Preferences|Preferences]]: preferences available for the OpenSCAD tools.


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 89: Line 110:
* [[Import_OpenSCAD_code|Importar código OpenSCAD]]
* [[Import_OpenSCAD_code|Importar código OpenSCAD]]


<div class="mw-translate-fuzzy">
== Enlaces ==
== Enlaces ==
* [https://freecadweb.org/tracker/search.php?tag_string=OpenSCAD Open tickets tagged "Openscad" on the FreeCAD bugtracker]
* [https://freecadweb.org/tracker/search.php?tag_string=OpenSCAD Open tickets tagged "Openscad" on the FreeCAD bugtracker]
* [http://www.thingiverse.com/tag:openscad Elementos etiquetados con "Openscad" en Thingiverse]
* [http://www.thingiverse.com/tag:openscad Elementos etiquetados con "Openscad" en Thingiverse]
</div>


<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
Line 97: Line 120:
</div>
</div>



{{OpenSCAD Tools navi}}
{{OpenSCAD Tools navi{{#translation:}}}}
{{Userdocnavi}}
{{Userdocnavi{{#translation:}}}}
[[Category:Workbenches]]
[[Category:Workbenches{{#translation:}}]]

Revision as of 21:47, 25 March 2020

OpenSCAD workbench icon

El módulo OpenSCAD está en un estado de desarrollo inicial.

The OpenSCAD Workbench is intended to offer interoperability with the open source software OpenSCAD. This program is not distributed as part of FreeCAD, but should be installed to make full use of this workbench.

Contiene un importador que permite abrir los archivos .csg de OpenSCAD en FreeCAD.

This workbench contains functions to modify the CSG feature tree and repair models. It also contains general purpose tools that do not require installation of OpenSCAD; they can be used in conjunction with other workbenches. For example, the Mesh Workbench internally uses the OpenSCAD functions to perform operations with meshes, as they are quite robust.

Dependencies

In FreeCAD 0.19, the Ply (Python-Lex-Yacc) module, which is used to import CSG files, was removed from the FreeCAD source code, as it is a third party library not developed by FreeCAD. As a result, you now need to install Ply before using the OpenSCAD Workbench. When using a pre-packaged, stable version of FreeCAD this dependency should be installed automatically in all platforms; in other cases, for example, when compiling from source, you may have to install it from an online repository.

In Debian/Ubuntu based systems this is done like this.

sudo apt install python3-ply

The general installation in all platforms can be done from the Python package index.

pip3 install --user ply

OpenSCAD lenguaje y formato de archivo

El lenguaje de OpenSCAD permite la utilización de variables y bucles. Permite especificar submódulos para reutilizar geometría y código. Esta alto grado de flexibilidad hace el análisis sintáctico muy complejo. Actualmente el módulo OpenSCAD en FreeCAD no puede manejar el lenguaje de OpenSCAD de forma nativa. En cambio si OpenSCAD está instalado, se puede utilizar para convertir la entrada en un formato de salida denominado 'CSG'. Es un subconjunto del lenguaje OpenSCAD y se puede utilizar como la entrada de OpenSCAD para su procesamiento posterior.

Durante la conversión todo el comportamiento paramétrico se pierde. Todos los nombres de variables serán desechados, los bucles expandidos y las expresiones matemáticas evaluadas.

The OpenSCAD language allows the use of variables and loops. It allows you to specify sub-modules to reuse geometry and code. This high degree of flexibility makes parsing very complex. Currently the OpenSCAD Workbench cannot handle the OpenSCAD language natively. Instead, if OpenSCAD is installed, it can be used to convert the input to the CSG format, which is a subset of the OpenSCAD language, and can be used as the input to OpenSCAD for further processing. During conversion all parametric behavior is lost, meaning that all variable names are discarded, loops expanded, and mathematical expressions evaluated.

Comandos de la interfaz gráfica del usuario

  • ColorCodeShape: Cambia el color de la selección o todas las formas basadas en su validez
  • Reemplazar objeto: Reemplaza una objeto en el árbol de operaciones. Por favor, selecciona los objetos antiguos, nuevos y padres
  • Eliminar sub-árbol: Elimina los objetos seleccionados y todos sus descendientes que no estén referenciados desde otros objetos
  • Refinar operación de forma: Crea una operación de forma refinada
  • Increase Tolerance Feature: Aumenta la tolerancia de bordes/caras/vértice de objeto(s) seleccionado(s).
  • Aristas a caras: Convierte aristas a caras. Útil para preparar geometría DXF importada para su extrusión.
  • Expandir ubicación: Expande todas las ubicaciones por debajo del árbol de operaciones
  • Explotar grupo: explota las partes primitivas fusionadas.
  • Añadir elementos OpenSCAD: Añade un elemento OpenSCAD introduciendo código OpenSCAD en el panel de tareas y ejecutando el binario de OpenSCAD (requiere de OpenSCAD)
  • Mesh Boolean: Creates new mesh object by boolean operation from shapes.
  • Hull: Apllies a hull to selected shapes.
  • Minkowski: Applies a minkowski sum to selected shapes.

Preferencias

  • Preferencias: Preferencias para las herramientas de OpenSCAD.

Preferences

  • Preferences: preferences available for the OpenSCAD tools.

Limitaciones

OpenSCAD crea geometría sólida constructiva así como la importación de archivos de malla y extrusión de geometría 2D (a partir de archivos DXF). FreeCAD te permite crear CSG también con primitivas. El núcleo de geometría de FreeCAD (OCCT) funciona trabajando sobre una representación de los limites. Por tanto la conversión de CSG a BREP en teoría debería ser posible. Mientras que una conversión de BREP a CSG es, en general, imposible.

OpenSCAD funciona internamente sobre mallas. Algunas operaciones que son útiles en mallas no son significativas en un modelo BREP y no pueden ser totalmente compatibles. Entre estos se encuentran el convex hull, minkowski sum, glide y subdiv. Actualmente ejecutamos el binario OpenSCAD para realizar operaciones de hull y minkwoski e importar el resultado. Esto significa que la geometría involucrada será triangulada. En OpenSCAD, a menudo se usa una escala no uniforme, que no impone ningún problema cuando se usan mallas. En nuestra geometría, las primitivas geométricas del núcleo (líneas, secciones circulares, etc.) se convierten a BSpline antes de realizar tales deformaciones. Esas líneas de BS son conocidas por causar problemas en operaciones booleanas posteriores. Una solución automática no está disponible en este momento. Por favor, siéntase libre de publicar en el foro si encuentra tales problemas. A menudo, tales problemas se pueden resolver remodelando piezas pequeñas. Una deformación de un cilindro puede sustituirse por una extrusión de una elipsis.

Pistas

Cuando se importa DXF establecer la precisión a una cantidad sensible para que afecte a la detección de aristas conectadas.

Si FreeCAD se cuelga importando CSG, es muy recomendable activar 'automáticamente comprobar el modelo después de una operación booleana' en el menú Editar → Preferencias → Diseño de Piezas Parámetros del modelo

Tutoriales

Mesh Module/es
Part Module/es