Part Scinder

From FreeCAD Documentation
Revision as of 13:16, 11 April 2017 by Nemesis (talk | contribs) (Created page with "== Utilisation == # Sélectionnez l'objet à couper, d'abord, puis les objets servant a découper. <br /> L'ordre de sélection est important. Les composés avec auto-intersec...")

Part Slice

Emplacement du menu
Part → Split → Slice
Ateliers
Part
Raccourci par défaut
Aucun
Introduit dans la version
-
Voir aussi
Part Boolean Fragments, Part XOR, Join features, Part Booleans

Description

Outil pour séparer les formes par intersection avec d'autres formes. Par exemple, pour un cube et un plan, un composé de deux solides est créé.

(Sur l'image ci-dessus, les pièces ont été déplacées manuellement après l'operation, pour montrer le découpage)

La forme final occupe le même volume que l'original. Mais il est divisé la ou il intersecte les autres formes. Les pièces découpées sont placées dans un composé (ou compsolid), de sorte que l'objet semble rester en une seule pièce. Vous devez exploser le composé pour obtenir des pièces individuelles. Utilisez, par exemple, Draft Downgrade à cette fin.

L'outil comporte trois modes: "Standard", "Split" et "CompSolid".

"Standard" et "Split" diffèrent par l'action de l'outil sur les fils, les shells et les compsolids: Pour "Split", ceux-ci sont séparés; Pour «Standard», ils sont conservés ensemble (on obtient des segments supplémentaires).

Le composé dans les modes "Standard" et "Split" suit la structure de la pièce transhée

En mode "CompSolid", la sortie est un compsolid (ou un composé de compsolids, si les solides résultants ne sont pas connectés). Un compsolid est un ensemble de solides reliés par des faces; Ils sont liés aux solides, comme les arrete sont liés aux bords, et les coques sont liées aux faces; Le nom est probablement une phrase abrégée «solide composite».

Le résultat de l'outil est très similaire à Boolean Fragments, sauf que les parties de la première forme sont dans le résultat.

Utilisation

  1. Sélectionnez l'objet à couper, d'abord, puis les objets servant a découper.
    L'ordre de sélection est important. Les composés avec auto-intersections ne sont pas autorisés (les auto-intersections peuvent parfois être prises en compte en passant le composé via BooleanFragments)
  2. Appelez la commande Part Slice.

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

Properties

Slice

  • DonnéesBase: Object to be sliced.
  • DonnéesTools: 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).
  • DonnéesMode: "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).
  • DonnéesTolerance: "fuzziness" value. This is an extra tolerance to apply when searching for intersections, in addition to tolerances stored in the input shapes.

Example: making puzzle

  1. Switch to Sketcher Workbench, create an new sketch. Draw a rectangle that will outline the overall shape of the puzzle. Close the sketch.
  2. Switch to Part workbench. Select the sketch, and pick Part->Create face from sketch (in menu).
  3. Switch to Sketcher workbench, and create another sketch on the same plane. Using polyline tool, draw the lines that will split the puzzle into pieces.
  4. Switch 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 Split.
  6. Switch to Draft workbench, and apply Draft Downgrade to the result. You should get all the pieces as "Face00X" in document tree, that can be moved independently. Done!

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:

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

This can be useful for making custom Python scripted features.


Example:

import Part
j = Part.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 under where FreeCAD is installed.

Version

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.