Part RefineShape: Difference between revisions

From FreeCAD Documentation
mNo edit summary
(Removed useless info from Scripting paragraph.)
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:9-->
<!--T:9-->
{{Docnav
{{Docnav
|[[Part_ElementCopy|ElementCopy]]
|[[Part_ElementCopy|ElementCopy]]
|[[Part_CheckGeometry|CheckGeometry]]
|[[Part_CheckGeometry|CheckGeometry]]
|[[Part_Module|Part]]
|[[Part_Workbench|Part]]
|IconL=Part_ElementCopy.svg
|IconL=Part_ElementCopy.svg
|IconR=Part_CheckGeometry.svg
|IconR=Part_CheckGeometry.svg
Line 15: Line 16:
|Name=Part RefineShape
|Name=Part RefineShape
|MenuLocation=Part → Create a copy → Refine Shape
|MenuLocation=Part → Create a copy → Refine Shape
|Workbenches=[[Part_Module|Part]]
|Workbenches=[[Part_Workbench|Part]]
|SeeAlso=[[Part_SimpleCopy|Part SimpleCopy]], [[Part_TransformedCopy|Part TransformedCopy]], [[Part_ElementCopy|Part ElementCopy]], [[OpenSCAD_RefineShapeFeature|OpenSCAD RefineShapeFeature]]
|SeeAlso=[[Part_SimpleCopy|Part SimpleCopy]], [[Part_TransformedCopy|Part TransformedCopy]], [[Part_ElementCopy|Part ElementCopy]], [[OpenSCAD_RefineShapeFeature|OpenSCAD RefineShapeFeature]]
}}
}}
Line 34: Line 35:
<translate>
<translate>
<!--T:4-->
<!--T:4-->
{{Caption|Original boolean result (left), and refined shape copy (right).}}
{{Caption|Original boolean result with 11 faces (left), and refined shape copy with 7 faces (right).}}


==Usage== <!--T:3-->
==Usage== <!--T:3-->
Line 54: Line 55:
See other parameters in [[Fine-tuning|Fine-tuning]].
See other parameters in [[Fine-tuning|Fine-tuning]].


=== Limitations === <!--T:7-->
== Notes == <!--T:6-->

<!--T:21-->
* The refinement algorithm only works on shells. Therefore it iterates over the shells of the input shape and then for each shell it creates a new shell with joined faces wherever possible. This means that if your input shape is only a face, wire, edge or vertex then the algorithm does nothing.
* Unlike the [[Image:OpenSCAD_RefineShapeFeature.svg|24px]] [[OpenSCAD RefineShapeFeature|OpenSCAD RefineShapeFeature]] command, [[Image:Part_RefineShape.svg|24px]] [[Part_RefineShape|Part RefineShape]] won't update when the preceding shapes are changed.

=== Notes === <!--T:6-->


<!--T:22-->
<!--T:22-->
Line 67: Line 62:
* This clean up may stop 3D printers from printing unwanted edges once the solid model is exported to a mesh format.
* This clean up may stop 3D printers from printing unwanted edges once the solid model is exported to a mesh format.
* This function can also be used after converting a mesh to a shape ([[Part_ShapeFromMesh|ShapeFromMesh]]) to clean up the residual edges on flat faces.
* This function can also be used after converting a mesh to a shape ([[Part_ShapeFromMesh|ShapeFromMesh]]) to clean up the residual edges on flat faces.

== Limitations == <!--T:7-->

<!--T:21-->
* The refinement algorithm only works on shells. Therefore it iterates over the shells of the input shape and then for each shell it creates a new shell with joined faces wherever possible. This means that if your input shape is only a face, wire, edge or vertex then the algorithm does nothing.
* Unlike the [[Image:OpenSCAD_RefineShapeFeature.svg|24px]] [[OpenSCAD RefineShapeFeature|OpenSCAD RefineShapeFeature]] command, [[Image:Part_RefineShape.svg|24px]] [[Part_RefineShape|Part RefineShape]] won't update when the preceding shapes are changed.


==Scripting== <!--T:5-->
==Scripting== <!--T:5-->


<!--T:23-->
The Python command for refining a shape is the following:
The Python command for refining a shape is the following:


Line 77: Line 79:
}}
}}
<translate>
<translate>

The '''Part RefineShape''' command can be applied after selecting one or more objects in the [[Tree_view|Tree view]]:

</translate>
{{Code|code=
FreeCADGui.runCommand('Part_RefineShape')
}}
<translate>

The selection can be manual (by using the mouse), or via the [[Python_Console|Python Console]].<br>
To know more about selecting objects programmatically, refer to [[Selection_methods|Selection methods]].




Line 94: Line 85:
|[[Part_ElementCopy|ElementCopy]]
|[[Part_ElementCopy|ElementCopy]]
|[[Part_CheckGeometry|CheckGeometry]]
|[[Part_CheckGeometry|CheckGeometry]]
|[[Part_Module|Part]]
|[[Part_Workbench|Part]]
|IconL=Part_ElementCopy.svg
|IconL=Part_ElementCopy.svg
|IconR=Part_CheckGeometry.svg
|IconR=Part_CheckGeometry.svg

Revision as of 10:57, 18 September 2021

Part RefineShape

Menu location
Part → Create a copy → Refine Shape
Workbenches
Part
Default shortcut
None
Introduced in version
-
See also
Part SimpleCopy, Part TransformedCopy, Part ElementCopy, OpenSCAD RefineShapeFeature

Description

The Part RefineShape produces a non-parametric copy with a refined shape, that is, with certain edges and faces cleaned up.

After certain boolean operations, like Part Fuse, some lines from the previous shapes may remain visible. This tool produces a copy of that boolean result, and cleans up those seams.

Alternatively, to produce other non-parametric copies use Simple Copy, Transformed Copy, and Element Copy

Original boolean result with 11 faces (left), and refined shape copy with 7 faces (right).

Usage

  1. Select an object that you wish to clean and copy.
  2. Go to the menu Part → Create a copy → Refine shape.
  3. A cleaned, independent copy of the original object is created; the original object is hidden.

As of version 0.19 and above the result defaults to a parametric (linked) copy.

This behavior can be changed in the Parameter editor:

  1. Go to the subgroup: BaseApp/Preferences/Mod/Part
  2. Change ParametricRefine of type Boolean to false to get the old behavior (independent copy).

See other parameters in Fine-tuning.

Notes

  • This function can be used as the last step in the modelling work to clean up shapes in a traditional constructive solid geometry workflow.
  • This function may help to clean up the model before applying another feature, such as a Fillet.
  • This clean up may stop 3D printers from printing unwanted edges once the solid model is exported to a mesh format.
  • This function can also be used after converting a mesh to a shape (ShapeFromMesh) to clean up the residual edges on flat faces.

Limitations

  • The refinement algorithm only works on shells. Therefore it iterates over the shells of the input shape and then for each shell it creates a new shell with joined faces wherever possible. This means that if your input shape is only a face, wire, edge or vertex then the algorithm does nothing.
  • Unlike the OpenSCAD RefineShapeFeature command, Part RefineShape won't update when the preceding shapes are changed.

Scripting

The Python command for refining a shape is the following:

shape.removeSplitter()