OpenSCAD Workbench/pl: Difference between revisions

From FreeCAD Documentation
(Created page with "* 32px Oznacz kształt kolorem: Zmienia kolor wybranych lub wszystkich kształtów na podstawie ich znacze...")
No edit summary
Line 54: Line 54:


* [[Image:OpenSCAD_ColorCodeShape.svg|32px]] [[OpenSCAD_ColorCodeShape/pl|Oznacz kształt kolorem]]: Zmienia kolor wybranych lub wszystkich kształtów na podstawie ich znaczenia.
* [[Image:OpenSCAD_ColorCodeShape.svg|32px]] [[OpenSCAD_ColorCodeShape/pl|Oznacz kształt kolorem]]: Zmienia kolor wybranych lub wszystkich kształtów na podstawie ich znaczenia.
* [[Image:OpenSCAD_ReplaceObject.svg|32px]] [[OpenSCAD_ReplaceObject/pl|astąp obiekt]]: Zastępuje obiekt w drzewie cech.
* [[Image:OpenSCAD_ReplaceObject.svg|32px]] [[OpenSCAD_ReplaceObject/pl|Zastąp obiekt]]: Zastępuje obiekt w drzewie cech.
* [[Image:OpenSCAD_RemoveSubtree.svg|32px]] [[OpenSCAD_RemoveSubtree/pl|Usuń gałąź drzewa]]: Usuwa wybrane obiekty i wszystkie elementy podrzędne, do których nie istnieją odniesienia z innych obiektów.
* [[Image:OpenSCAD_RemoveSubtree.svg|32px]] [[OpenSCAD_RemoveSubtree/pl|Usuń gałąź drzewa]]: Usuwa wybrane obiekty i wszystkie elementy podrzędne, do których nie istnieją odniesienia z innych obiektów.
* [[Image:OpenSCAD_RefineShapeFeature.svg|32px]] [[OpenSCAD_RefineShapeFeature/pl|Udoskonal siatkę]]: Tworzy cechę udoskonalonego kształtu.
* [[Image:OpenSCAD_RefineShapeFeature.svg|32px]] [[OpenSCAD_RefineShapeFeature/pl|Udoskonal siatkę]]: Tworzy cechę udoskonalonego kształtu.
* [[Image:OpenSCAD_MirrorMeshFeature.svg|32px]] [[OpenSCAD_MirrorMeshFeature/pl|Dobicie lustrzane siatki]]: Tworzy cechę odbicia lustrzanego dla siatki.
* [[Image:OpenSCAD_MirrorMeshFeature.svg|32px]] [[OpenSCAD_MirrorMeshFeature/pl|Odbicie lustrzane siatki]]: Tworzy cechę odbicia lustrzanego dla siatki.
* [[Image:OpenSCAD_ScaleMeshFeature.svg|32px]] [[OpenSCAD_ScaleMeshFeature/pl|Skaluj cechę siatki]]: Skaluje elementy siatki.
* [[Image:OpenSCAD_ScaleMeshFeature.svg|32px]] [[OpenSCAD_ScaleMeshFeature/pl|Skaluj cechę siatki]]: Skaluje elementy siatki.
* [[Image:OpenSCAD_ResizeMeshFeature.svg|32px]] [[OpenSCAD_ResizeMeshFeature/pl|Zmień rozmiar cechy siatki]]: Zmień rozmiar elementu siatki.
* [[Image:OpenSCAD_ResizeMeshFeature.svg|32px]] [[OpenSCAD_ResizeMeshFeature/pl|Zmień rozmiar cechy siatki]]: Zmień rozmiar elementu siatki.
Line 66: Line 66:
* [[Image:OpenSCAD_AddOpenSCADElement.svg|32px]] [[OpenSCAD_AddOpenSCADElement/pl|Dodaj element OpenSCAD]]: Dodaj element OpenSCAD, wprowadzając kod OpenSCAD do panelu zadań.
* [[Image:OpenSCAD_AddOpenSCADElement.svg|32px]] [[OpenSCAD_AddOpenSCADElement/pl|Dodaj element OpenSCAD]]: Dodaj element OpenSCAD, wprowadzając kod OpenSCAD do panelu zadań.
* [[Image:OpenSCAD_MeshBoolean.svg|32px]] [[OpenSCAD_MeshBoolean/pl|Operacja logiczna na siatce]]: Tworzy nowy obiekt siatki za pomocą operacji logicznej z kształtów.
* [[Image:OpenSCAD_MeshBoolean.svg|32px]] [[OpenSCAD_MeshBoolean/pl|Operacja logiczna na siatce]]: Tworzy nowy obiekt siatki za pomocą operacji logicznej z kształtów.
* [[Image:OpenSCAD_Hull.svg|32px]] [[OpenSCAD_Hull/pl|Hull]]: Applies a hull to selected shapes.
* [[Image:OpenSCAD_Hull.svg|32px]] [[OpenSCAD_Hull/pl|Hull]]: Stosuje funkcję a hull do wybranych kształtów.
* [[Image:OpenSCAD_Minkowski.svg|32px]] [[OpenSCAD_Minkowski/pl|Minkowski]]: Stosuje sumę minkowskiego do wybranych kształtów.
* [[Image:OpenSCAD_Minkowski.svg|32px]] [[OpenSCAD_Minkowski/pl|Minkowski]]: Stosuje sumę minkowskiego do wybranych kształtów.



Revision as of 08:37, 15 May 2022

Ikonka FreeCAD dla Środowiska pracy OpenSCAD

Wprowadzenie

Środowisko pracy OpenSCAD służy do zapewnienia interoperacyjności z oprogramowaniem OpenSCAD. Program ten nie jest częścią projektu FreeCAD i by zapewnić pełną funkcjonalność tego środowiska należy zainstalować go samodzielnie.

OpenSCAD nie powinien być mylony z OpenCASCADE będącym nierozłącznym komponentem FreeCAD odpowiedzialnym za opis geometrii. Instalacja oprogramowania OpenSCAD jest w pełni opcjonalna.

It contains a CSG importer to open the CSG files from OpenSCAD, and an exporter to output a CSG based tree. Geometry which is not based on CSG operations will be exported as a mesh.

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.

Zależności

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.

W dystrybucjach opartych o openSUSE środowisko może zostać zainstalowane za pomocą:

sudo zypper install python3-ply

W dystrybucjach opartych o Debian / Ubuntu środowisko może zostać zainstalowane za pomocą:

sudo apt install python3-ply

Ogólna instalacja na wszystkich platformach może być wykonana z indeksu pakietów Pythona.

pip3 install --user ply

OpenSCAD language and file format

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.

Przybory

Ustawienia

  • Preferencje: ustawienia dostępne dla środowiska OpenSCAD.

Ograniczenia

OpenSCAD creates constructive solid geometry, as well as imports mesh files and extrudes 2D geometry from DXF files. FreeCAD allows you to create CSG with primitives as well. The FreeCAD geometry kernel (OCCT) works using a boundary representation. Therefore conversion from CSG to BREP should, in theory, be possible whereas conversion from BREP to CSG is, in general, not.

OpenSCAD works internally on meshes. Some operations which are useful on meshes are not meaningful on a BREP model and can not be fully supported. Among these are convex hull, minkowski sum, glide and subdiv. Currently we run the OpenSCAD binary in order to perform hull and minkwoski operations and import the result. This means that the involved geometry will be triangulated. In OpenSCAD non-uniform scaling is often used, which does not impose any problems when using meshes. In our geometry kernel geometric primitives (lines, circular sections, etc) are converted to BSpline prior to performing such deformations. Those BSplines are known to cause trouble in later boolean operations. An automatic solution is not available at the moment. Please feel free to post to the forum if you encounter such problems. Often such problems can be solved be remodeling small parts. A deformation of a cylinder can substituted by an extrusion of an ellipses.

Importing text

Importing OpenSCAD code with texts requires that the fonts that are used are properly installed on your system. You can verify this by opening OpenSCAD as a standalone tool and checking the list in Help → Font List. The list will also give you the correct font names. If a font does not appear in the list after installing, you may have to manually copy the font file to the appropriate system directory.

Importing texts is relatively slow. Behind the scenes FreeCAD uses a DXF file created by OpenSCAD. The more contours there are the slower the import.

It can be a good idea to first import a simple test case (replace NameOfFont with the correct font name):

TESTFONT="NameOfFont";
linear_extrude(0.001) {
  text("A", size=5, font=TESTFONT, script="Latn");
};

The script="Latn" parameter can be left out here, but is required if the text string does not contain any letters, but only punctuation and/or numbers.

Please note that use <FONT>; statements in your source files are ignored when importing in FreeCAD. Under OpenSCAD the effect of a use statement is that the provided font file is temporarily added to the list of known fonts (although even there the statement does not work when a script is modified interactively).

Wskazówki

When importing DXF set the Draft precision to a sensible amount as this will affect the detection of connected edges.

If FreeCAD crashes when importing CSG, it is strongly recommended that you enable "automatically check model after boolean operation" in Menu → Edit → Preferences → Part Design → Model setting.

Poradniki

Odnośniki internetowe