Part Slice/pl: Difference between revisions

From FreeCAD Documentation
(Created page with "'''Standard''' i '''Podziel''' różnią się działaniem narzędzia na linach, powłokach i bryłach. W przypadku opcji "Podziel" są one rozdzielane. W przypadku opcji "Standard" są one utrzymywane razem ''(otrzymują dodatkowe segmenty)''.")
(Created page with "Struktura łączenia w trybach "Standard" i "Podziel" jest zgodna ze strukturą łączenia krojonego kształtu.")
Line 35: Line 35:
'''Standard''' i '''Podziel''' różnią się działaniem narzędzia na linach, powłokach i bryłach. W przypadku opcji "Podziel" są one rozdzielane. W przypadku opcji "Standard" są one utrzymywane razem ''(otrzymują dodatkowe segmenty)''.
'''Standard''' i '''Podziel''' różnią się działaniem narzędzia na linach, powłokach i bryłach. W przypadku opcji "Podziel" są one rozdzielane. W przypadku opcji "Standard" są one utrzymywane razem ''(otrzymują dodatkowe segmenty)''.


Struktura łączenia w trybach "Standard" i "Podziel" jest zgodna ze strukturą łączenia krojonego kształtu.
Compounding structure in "Standard" and "Split" modes follows the compounding structure of shape being sliced.


In "CompSolid" mode, the output is a compsolid (or a compound of compsolids, if the resulting solids form more than one island of connectedness). Compsolid is a set of solids connected by faces; they are related to solids like wires are related to edges, and shells are related to faces; the name is probably a shortened phrase "composite solid".
In "CompSolid" mode, the output is a compsolid (or a compound of compsolids, if the resulting solids form more than one island of connectedness). Compsolid is a set of solids connected by faces; they are related to solids like wires are related to edges, and shells are related to faces; the name is probably a shortened phrase "composite solid".

Revision as of 15:31, 4 July 2023

Część: Rozbij na kształty złożenia

Lokalizacja w menu
Część → Rozdziel → Rozbij na kształty złożenia
Środowisko pracy
Część
Domyślny skrót
brak
Wprowadzono w wersji
0.17
Zobacz także
Funkcja logiczna rozdzielająca, Logiczny XOR, Połącz obiekty, Operacje logiczne na bryłach

Opis

Narzędzie Rozbij na kształty złożenia znane również jako Pokrój na składniki służy do dzielenia kształtów przez przecięcie z innymi kształtami. Na przykład dla prostopadłościanu i płaszczyzny zostanie utworzone złożenie dwóch brył.

Powyżej: elementy zostały później ręcznie rozsunięte, aby uwidocznić cięcie.

Istnieją dwa polecenia do przecinania kształtu: Rozbij i Rozbij na kształty złożenia. Oba tworzą parametryczną cechę Rozbicia, która umieszcza pokrojone kawałki w złożeniu. Jednakże Rozbij rozbija powstałe złożenie na oddzielne obiekty. "Rozbij na kształty złożenia" jest w pełni parametryczne i nie powoduje żadnych problemów, gdy zmienia się liczba części. Natomiast "Rozbij" nie aktualizuje liczby obiektów wraz ze zmianą liczby części.

Kształt wyjściowy zajmuje tę samą przestrzeń co oryginał. Jest on jednak dzielony tam, gdzie przecina się z innymi kształtami. Podzielone części są umieszczane w bryle złożonej (lub bryle zespolonej), więc obiekt wydaje się pozostawać w jednym kawałku. Musisz rozbić złożenie, aby uzyskać poszczególne elementy. Jeśli chcesz uzyskać dostęp do poszczególnych części w sposób parametryczny, możesz użyć do tego celu Filtra złożeń. Dla szybkiego dostępu nieparametrycznego użyj narzędzia Rozbij kształt.

Narzędzie ma trzy tryby pracy: "Standardowy", "Podziel" i "BryłaZłożona". Nie ma żadnego formularza wyboru, są one predefiniowane, ale można uzyskać do nich dostęp po wykonaniu operacji na poziomie wynikowych segmentów.

Standard i Podziel różnią się działaniem narzędzia na linach, powłokach i bryłach. W przypadku opcji "Podziel" są one rozdzielane. W przypadku opcji "Standard" są one utrzymywane razem (otrzymują dodatkowe segmenty).

Struktura łączenia w trybach "Standard" i "Podziel" jest zgodna ze strukturą łączenia krojonego kształtu.

In "CompSolid" mode, the output is a compsolid (or a compound of compsolids, if the resulting solids form more than one island of connectedness). Compsolid is a set of solids connected by faces; they are related to solids like wires are related to edges, and shells are related to faces; the name is probably a shortened phrase "composite solid".

The overall action of the tool is very similar to Part Boolean Fragments, except only the pieces from the first shape are in the result.

Usage

  1. Select the object to be sliced, first, and then some objects to slice with.
    The order of selection is important. Compounds with self-intersections are not allowed (self-intersections sometimes can be accounted for by passing the compound through Part Boolean Fragments)
  2. Invoke the Part Slice command several ways:
    • Press the Part Slice button in the Part toolbar
    • Use the Part → Split → Slice to compound entry in the Part menu
  1. Noteː The Objects to slice with must completely separate the object to be sliced. Thus a cube cannot be sliced by a wire, but by a plane derived from an extruded wire for instance.

A Slice parametric object is created. Original objects are hidden, and the result of intersection is shown in 3D view.

Tree structure of Slice

The Slice command creates a sliced object. In the following example a cube is sliced by a face.

The slice is created and each piece of it is united in a Compound.

Properties

Slice

  • DANEBase: Object to be sliced.
  • DANETools: List of objects to slice with. (as of FreeCAD v0.17.8053, this property is not displayed in property editor, and can only be accessed via Python).
  • DANEMode: "Standard", "Split", or "CompSolid". "Split" is default. Standard and Split differ by the action of the tool on aggregation type shapes: if Split, those are separated; otherwise they are kept together (get extra segments).
  • DANETolerance: "fuzziness" value. This is an extra tolerance to apply when searching for intersections, in addition to tolerances stored in the input shapes.

̈Noteː Properties are accessible on the slices inner object, not on the result level.

Example

Creating a Puzzle

  1. Switch to Sketcher Workbench
    • Create a new sketch.
    • Draw a rectangle that will outline the overall shape of the puzzle.
    • Close the sketch.
  2. Switch to Part workbench.
  3. Switch back to Sketcher Workbench
    • Create another sketch on the same plane.
    • Using polyline tool, draw the lines that will split the puzzle into pieces.
  4. Switch back to Part Workbench.
    • Select the splitter sketch, and apply Part Boolean Fragments. This will insert vertices where lines of splitter sketch intersect. Having them is essential for the next step to work.
  5. Select the rectangular face, and the BooleanFragments of splitter sketch, and apply Part Slice.
  6. Use Part ExplodeCompound on the sliced face, to break apart the compound made by Part Slice into individual pieces.

Note: Steps 5 and 6 can be done in single click using Part SliceApart

Notes

  • The tool was introduced in FreeCAD v0.17.8053. FreeCAD needs to be compiled with OCC 6.9.0 or later; otherwise, the tool is unavailable.
  • ̈Properties are accessible on the slices inner object, not on the result level.
  • The Objects to slice with must completely separate the object to be sliced. Thus a cube cannot be sliced by a wire, but by a plane derived from an extruded wire for instance.
  • Slicing object must pass BOP check. See Part CheckGeometry.

Scripting

The tool can by used in macros and from the Python console by using the following function:

BOPTools.SplitFeatures.makeSlice(name)
  • Creates an empty Slice feature. The 'Base' and 'Tools' properties must be assigned explicitly, afterwards.
  • Returns the newly created object.

Slice can also be applied to plain shapes, without the need to have a document object, via:

BOPTools.SplitAPI.slice(base_shape, tool_shapes, mode, tolerance = 0.0)

This can be useful for making custom Python scripted features.


Example:

import BOPTools.SplitFeatures
j = BOPTools.SplitFeatures.makeSlice(name= 'Slice')
j.Base = FreeCADGui.Selection.getSelection()[0]
j.Tools = FreeCADGui.Selection.getSelection()[1:]

The tool itself is implemented in Python, see /Mod/Part/BOPTools/SplitFeatures.py (GitHub link) within the FreeCAD installation directory.


Tutorials