Part ShapeFromMesh/fr: Difference between revisions

From FreeCAD Documentation
(Created page with "* [https://www.youtube.com/watch?v=5lwENZeNiNg&feature=youtu.be Edit STL Files In FreeCAD] vidéo par AllVisuals4U.")
(Created page with "La création d'une Shape à partir d'un Maillage peut être fait en utilisant la méthode {{incode|makeShapeFromMesh}} à partir d'un Part_TopoShape...")
Line 38: Line 38:
==Script==
==Script==


Creating a [[Shape|Shape]] from a [[Mesh|Mesh]] can be done by using the {{incode|makeShapeFromMesh}} method from a [[Part_TopoShape|Part TopoShape]]; you need to specify the source mesh and tolerance, and assign the result to a new [[Part_Feature|Part Feature]] object.
La création d'une [[Shape/fr|Shape]] à partir d'un [[Mesh/fr|Maillage]] peut être fait en utilisant la méthode {{incode|makeShapeFromMesh}} à partir d'un [[Part_TopoShape/fr|Part TopoShape]]. Vous devez spécifier le maillage source et la tolérance et affecter le résultat à un nouvel objet [[Part_Feature/fr|Part Feature]].


Notice that the mesh must be recalculated before it is converted to a Shape, otherwise there won't be topology information, and the conversion won't be successful.
Notice that the mesh must be recalculated before it is converted to a Shape, otherwise there won't be topology information, and the conversion won't be successful.

Revision as of 14:50, 19 September 2020

Part Forme à partir du maillage

Emplacement du menu
Pièce → Créer la forme à partir d'un maillage...
Ateliers
Pièce
Raccourci par défaut
Aucun
Introduit dans la version
-
Voir aussi
Part Convertir en solide, Part Affiner la forme, Part Points à partir de maillage

Introduction

Cette commande Part Forme à partir du maillage crée une forme à partir d'un Maillage. FreeCAD offre des possibilités d’édition limitées des maillages; les convertir en shapes (formes) permettra leur usage par beaucoup plus d'outils de FreeCAD.

Utilisation

  1. Sélectionnez l'objet mesh dans la Vue en arborescence.
  2. Allez dans le menu, Pièce → Créer une forme à partir d'un maillage....
  3. Un menu contextuel demandera la tolérance pour la forme de la pièce. La valeur par défaut est 0.1.
  4. Une forme de l'objet maillage est créée en tant que nouvel objet séparé.

L'analyse et la réparation du maillage, si nécessaire, doivent être effectuées manuellement avant de lancer Créer la forme à partir d'un maillage... . Les outils appropriés pour cette tâche sont disponibles dans l' Atelier Mesh.

Après la création d'une Shape, il peut être utile d'utiliser Convertir en solide (nécessaire pour les Operations booléennes) et Affiner la forme.

Liens

Script

La création d'une Shape à partir d'un Maillage peut être fait en utilisant la méthode makeShapeFromMesh à partir d'un Part TopoShape. Vous devez spécifier le maillage source et la tolérance et affecter le résultat à un nouvel objet Part Feature.

Notice that the mesh must be recalculated before it is converted to a Shape, otherwise there won't be topology information, and the conversion won't be successful.

import FreeCAD as App
import Part

doc = App.newDocument()
mesh = doc.addObject("Mesh::Cube", "Mesh")
mesh.recompute()

solid = doc.addObject("Part::Feature", "Shape")
shape = Part.Shape()
shape.makeShapeFromMesh(mesh.Mesh.Topology, 0.1)

solid.Shape = shape
solid.Placement.Base = App.Vector(15, 0, 0)
solid.purgeTouched()
doc.recompute()