Mesh API/it: Difference between revisions

From FreeCAD Documentation
(Created page with "{{APIFunction|addFacet|Facet|Aggiunge una sfaccettatura alla maglia| }} {{APIFunction|addFacets|list|Aggiunge un elenco di sfaccettature alla maglia| }} {{APIFunction|addMesh|...")
(Updating to match new version of source page)
Line 11: Line 11:




{{APIFunction|addFacet|Facet|Aggiunge una sfaccettatura alla maglia| }}
{{APIFunction|addFacet|Facet|Adds a facet to the mesh| }}
{{APIFunction|addFacets|list|Aggiunge un elenco di sfaccettature alla maglia| }}
{{APIFunction|addFacets|list|Adds a list of facets to the mesh| }}
{{APIFunction|addMesh|Mesh|Combina questa mesh con un'altra mesh.| }}
{{APIFunction|addMesh|Mesh|Combines this mesh with another mesh.| }}
{{APIFunction|clear| |Cancella la mesh| }}
{{APIFunction|clear| |Clears the mesh| }}
{{APIFunction|coarsen| |Rende grossolana la mesh| }}
{{APIFunction|coarsen| |Coarsens the mesh| }}
{{APIFunction|collapseEdge|Edge|Rimuove un bordo e entrambe le sfaccettature che condividono questo bordo| }}
{{APIFunction|collapseEdge|Edge|Removes an edge and both facets that share this edge| }}
{{APIFunction|collapseFacet|Facet|Rimuove una sfaccettatura| }}
{{APIFunction|collapseFacet|Facet|Removes a facet| }}
{{APIFunction|collapseFacets|list|Rimuove una seriea di sfaccettature| }}
{{APIFunction|collapseFacets|list|Removes a list of facets| }}
{{APIFunction|copy| |Crea una copia di questa maglia | un oggetto Mesh}}
{{APIFunction|copy| |Creates a copy of this mesh|a Mesh object}}
{{APIFunction|countComponents| |Ottiene il numero di aree topologiche indipendenti | un intero}}
{{APIFunction|countComponents| |Get the number of topological independent areas|an integer}}
{{APIFunction|countNonUniformOrientedFacets| |Ottiene il numero di sfaccettature orientate male | un intero}}
{{APIFunction|countNonUniformOrientedFacets| |Get the number of wrong oriented facets|an integer}}
{{APIFunction|countSegments| |Ottiene il numero di segmenti che possono essere anche 0 | un numero intero}}
{{APIFunction|countSegments| |Get the number of segments which may also be 0|an integer}}
{{APIFunction|crossSections| |Ottiene sezioni trasversali della rete attraverso diversi piani| }}
{{APIFunction|crossSections| |Get cross-sections of the mesh through several planes| }}
{{APIFunction|difference|Mesh|Differenze tra questo oggetto e l'oggetto mesh dato.| }}
{{APIFunction|difference|Mesh|Difference of this and the given mesh object.| }}
{{APIFunction|fillupHoles| |Riempie i fori| }}
{{APIFunction|fillupHoles| |Fillup holes| }}
{{APIFunction|fixDeformations| |Ripara le faccette deformate| }}
{{APIFunction|fixDeformations| |Repair deformed facets| }}
{{APIFunction|fixDegenerations| |Rimuove le sfaccettature degenerate| }}
{{APIFunction|fixDegenerations| |Remove degenerated facets| }}
{{APIFunction|fixIndices| |Ripara eventuali indici non validi| }}
{{APIFunction|fixIndices| |Repair any invalid indices| }}
{{APIFunction|fixSelfIntersections| |Ripara le autointersezioni| }}
{{APIFunction|fixSelfIntersections| |Repair self-intersections| }}
{{APIFunction|flipNormals| |Inverte le normali delle mesh| }}
{{APIFunction|flipNormals| |Flip the mesh normals| }}
{{APIFunction|foraminate| |Ottiene un elenco di indici delle faccette e dei punti di intersezione| }}
{{APIFunction|foraminate| |Get a list of facet indices and intersection points| }}
{{APIFunction|getPlanes| |Ottiene tutti i piani della rete come segmento. Nel caso peggiore ogni triangolo può essere considerato come unico piano se nessuno dei suoi vicini è complanare.| }}
{{APIFunction|getPlanes| |Get all planes of the mesh as segment. In the worst case each triangle can be regarded as single plane if none of its neighbors is coplanar.| }}
{{APIFunction|getSegment|integer|Ottiene un elenco di indici delle faccette che descrivono un segmento| }}
{{APIFunction|getSegment|integer|Get a list of facet indices that describes a segment| }}
{{APIFunction|getSeparateComponents| |Restituisce una lista contenente le diverse componenti (aree separate) della rete come mesh separate |una lista}}
{{APIFunction|getSeparateComponents| |Returns a list containing the different components (separated areas) of the mesh as separate meshes|a list}}
{{APIFunction|harmonizeNormals| |Regola le sfaccettature orientate male| }}
{{APIFunction|harmonizeNormals| |Adjust wrong oriented facets| }}
{{APIFunction|hasNonManifolds| |Controlla se la mesh contiene non-manifolds | un booleano}}
{{APIFunction|hasNonManifolds| |Check if the mesh has non-manifolds|a boolean}}
{{APIFunction|hasNonUniformOrientedFacets| |Verifica se la rete ha dellle sfaccettature con orientamento incoerente| }}
{{APIFunction|hasNonUniformOrientedFacets| |Checks if the mesh has facets with inconsistent orientation| }}
{{APIFunction|hasSelfIntersections| |Controlla se la mesh si interseca| }}
{{APIFunction|hasSelfIntersections| |Check if the mesh intersects itself| }}
{{APIFunction|inner| |Ottiene la parte interna all'intersezione| }}
{{APIFunction|inner| |Get the part inside of the intersection| }}
{{APIFunction|insertVertex|Vertex|Inserisce un vertice in una sfaccettatura| }}
{{APIFunction|insertVertex|Vertex|Inserts a vertex into a facet| }}
{{APIFunction|intersect|Mesh|Intersezione tra questo oggetto e l'oggetto mesh dato.| }}
{{APIFunction|intersect|Mesh|Intersection of this and the given mesh object.| }}
{{APIFunction|isSolid| |Controlla se la mesh è un solido| }}
{{APIFunction|isSolid| |Check if the mesh is a solid| }}
{{APIFunction|meshFromSegment| |Creare una mesh da un segmento| }}
{{APIFunction|meshFromSegment| |Create a mesh from segment| }}
{{APIFunction|nearestFacetOnRay|tuple, tuple|Get the index and intersection point of the nearest facet to a ray. The first parameter is a tuple of three floats the base point of the ray, the second parameter is ut uple of three floats for the direction. The result is a dictionary with an index and the intersection point or an empty dictionary if there is no intersection.|a dictionary}}
{{APIFunction|nearestFacetOnRay|tuple, tuple|Get the index and intersection point of the nearest facet to a ray. The first parameter is a tuple of three floats the base point of the ray, the second parameter is ut uple of three floats for the direction. The result is a dictionary with an index and the intersection point or an empty dictionary if there is no intersection.|a dictionary}}
{{APIFunction|offset|float|Sposta il punto lungo le sue normali| }}
{{APIFunction|offset|float|Move the point along their normals| }}
{{APIFunction|offsetSpecial|float|Sposta il punto lungo le sue normali| }}
{{APIFunction|offsetSpecial|float|Move the point along their normals| }}
{{APIFunction|optimizeEdges| |Ottimizza i bordi per ottenere delle faccette migliori| }}
{{APIFunction|optimizeEdges| |Optimize the edges to get nicer facets| }}
{{APIFunction|optimizeTopology| |Ottimizza i bordi per ottenere delle faccette migliori| }}
{{APIFunction|optimizeTopology| |Optimize the edges to get nicer facets| }}
{{APIFunction|outer| |Ottiene la parte al di fuori l'intersezione| }}
{{APIFunction|outer| |Get the part outside the intersection| }}
{{APIFunction|printInfo| |Ottiene informazioni dettagliate sulla mesh| }}
{{APIFunction|printInfo| |Get detailed information about the mesh| }}
{{APIFunction|read| |Read in a mesh object from file.| }}
{{APIFunction|read| |Read in a mesh object from file.| }}
{{APIFunction|refine| |Refine the mesh| }}
{{APIFunction|refine| |Refine the mesh| }}
Line 76: Line 76:
{{APIProperty|CountFacets|the number of facets of the mesh object.}}
{{APIProperty|CountFacets|the number of facets of the mesh object.}}
{{APIProperty|CountPoints|the number of vertices of the mesh object.}}
{{APIProperty|CountPoints|the number of vertices of the mesh object.}}
{{APIProperty|Facets|A collection of facets; With this attribute it is possible to get access to the facets of the mesh: for p in mesh.Facets: print p}}
{{APIProperty|Facets|A collection of facets; With this attribute it is possible to get access to the facets of the mesh: for f in mesh.Facets: print f. Facet.Points is a list of coordinate-tupels for the vertices. Facet.PointIndices is a list of indice for the vertices of the facet. WARNING! store Facets in a local variable as it is generated on the fly, each time it is accessed.}}
{{APIProperty|Points|A collection of the mesh points; With this attribute it is possible to get access to the points of the mesh: for p in mesh.Points: print p.x, p.y, p.z}}
{{APIProperty|Points|A collection of the mesh points; With this attribute it is possible to get access to the points of the mesh: for p in mesh.Points: print p.x, p.y, p.z,p.Index.WARNING! store Points in a local variable as it is generated on the fly, each time it is accessed.}}
{{APIProperty|Topology|the points and face indices as tuple. Topology[0] is a list of all vertices. Each being a tuple of 3 coordinates. Topology[1] is a list of all polygons. Each being a list of vertex indice into Topology[0] WARNING! store Topology in a local variable as it is generated on the fly, each time it is accessed.}}
{{APIProperty|Topology|the points and face indices as tuple.}}
{{APIProperty|Volume|the volume of the mesh object.}}
{{APIProperty|Volume|the volume of the mesh object.}}
{{APIProperty|BoundBox|the BoundBox of the object}}
{{APIProperty|BoundBox|the BoundBox of the object}}

Revision as of 11:19, 28 January 2017

Gli oggetti mesh possono essere manipolati aggiungendo nuove sfaccettature, cancellando delle sfaccettature, importando da un file STL, trasformando la rete e in molti altri modi. Per una panoramica completa di ciò che si può fare vedere anche la documentazione del Modulo Mesh. Un oggetto mesh non può essere aggiunto direttamente ad un documento esistente. Pertanto, il documento deve creare un oggetto con una classe appropriataa che supporta le mesh. Esempio:

m = Mesh.Mesh()
... # Manipulate the mesh
d = FreeCAD.activeDocument() # Get a reference to the actie document
f = d.addObject("Mesh::Feature", "Mesh") # Create a mesh feature
f.Mesh = m # Assign the mesh object to the internal property
d.recompute()


addFacet(Facet)

Description: Adds a facet to the mesh

Returns:

addFacets(list)

Description: Adds a list of facets to the mesh

Returns:

addMesh(Mesh)

Description: Combines this mesh with another mesh.

Returns:

clear( )

Description: Clears the mesh

Returns:

coarsen( )

Description: Coarsens the mesh

Returns:

collapseEdge(Edge)

Description: Removes an edge and both facets that share this edge

Returns:

collapseFacet(Facet)

Description: Removes a facet

Returns:

collapseFacets(list)

Description: Removes a list of facets

Returns:

copy( )

Description: Creates a copy of this mesh

Returns: a Mesh object

countComponents( )

Description: Get the number of topological independent areas

Returns: an integer

countNonUniformOrientedFacets( )

Description: Get the number of wrong oriented facets

Returns: an integer

countSegments( )

Description: Get the number of segments which may also be 0

Returns: an integer

crossSections( )

Description: Get cross-sections of the mesh through several planes

Returns:

difference(Mesh)

Description: Difference of this and the given mesh object.

Returns:

fillupHoles( )

Description: Fillup holes

Returns:

fixDeformations( )

Description: Repair deformed facets

Returns:

fixDegenerations( )

Description: Remove degenerated facets

Returns:

fixIndices( )

Description: Repair any invalid indices

Returns:

fixSelfIntersections( )

Description: Repair self-intersections

Returns:

flipNormals( )

Description: Flip the mesh normals

Returns:

foraminate( )

Description: Get a list of facet indices and intersection points

Returns:

getPlanes( )

Description: Get all planes of the mesh as segment. In the worst case each triangle can be regarded as single plane if none of its neighbors is coplanar.

Returns:

getSegment(integer)

Description: Get a list of facet indices that describes a segment

Returns:

getSeparateComponents( )

Description: Returns a list containing the different components (separated areas) of the mesh as separate meshes

Returns: a list

harmonizeNormals( )

Description: Adjust wrong oriented facets

Returns:

hasNonManifolds( )

Description: Check if the mesh has non-manifolds

Returns: a boolean

hasNonUniformOrientedFacets( )

Description: Checks if the mesh has facets with inconsistent orientation

Returns:

hasSelfIntersections( )

Description: Check if the mesh intersects itself

Returns:

inner( )

Description: Get the part inside of the intersection

Returns:

insertVertex(Vertex)

Description: Inserts a vertex into a facet

Returns:

intersect(Mesh)

Description: Intersection of this and the given mesh object.

Returns:

isSolid( )

Description: Check if the mesh is a solid

Returns:

meshFromSegment( )

Description: Create a mesh from segment

Returns:

nearestFacetOnRay(tuple, tuple)

Description: Get the index and intersection point of the nearest facet to a ray. The first parameter is a tuple of three floats the base point of the ray, the second parameter is ut uple of three floats for the direction. The result is a dictionary with an index and the intersection point or an empty dictionary if there is no intersection.

Returns: a dictionary

offset(float)

Description: Move the point along their normals

Returns:

offsetSpecial(float)

Description: Move the point along their normals

Returns:

optimizeEdges( )

Description: Optimize the edges to get nicer facets

Returns:

optimizeTopology( )

Description: Optimize the edges to get nicer facets

Returns:

outer( )

Description: Get the part outside the intersection

Returns:

printInfo( )

Description: Get detailed information about the mesh

Returns:

read( )

Description: Read in a mesh object from file.

Returns:

refine( )

Description: Refine the mesh

Returns:

removeComponents(integer)

Description: Remove components with less or equal to number of given facets

Returns:

removeDuplicatedFacets( )

Description: Remove duplicated facets

Returns:

removeDuplicatedPoints( )

Description: Remove duplicated points

Returns:

removeFacets(list)

Description: Remove a list of facet indices from the mesh

Returns:

removeFoldsOnSurface( )

Description: Remove folds on surfaces

Returns:

removeNonManifolds( )

Description: Remove non-manifolds

Returns:

rotate( )

Description: Apply a rotation to the mesh

Returns:

setPoint(int, Vector)

Description: Sets the point at index.

Returns:

smooth( )

Description: Smooth the mesh

Returns:

snapVertex( )

Description: Insert a new facet at the border

Returns:

splitEdge( )

Description: Split edge

Returns:

splitEdges( )

Description: Split all edges

Returns:

splitFacet( )

Description: Split facet

Returns:

swapEdge( )

Description: Swap the common edge with the neighbor

Returns:

transform( )

Description: Apply a transformation to the mesh

Returns:

transformToEigen( )

Description: Transform the mesh to its eigenbase

Returns:

translate(Vector)

Description: Apply a translation to the mesh

Returns:

unite(Mesh)

Description: Union of this and the given mesh object.

Returns:

write(string)

Description: Write the mesh object into file.

Returns:

writeInventor( )

Description: Write the mesh in OpenInventor format to a string.

Returns: a string

Area

Returns: the area of the mesh object.

CountFacets

Returns: the number of facets of the mesh object.

CountPoints

Returns: the number of vertices of the mesh object.

Facets

Returns: A collection of facets; With this attribute it is possible to get access to the facets of the mesh: for f in mesh.Facets: print f. Facet.Points is a list of coordinate-tupels for the vertices. Facet.PointIndices is a list of indice for the vertices of the facet. WARNING! store Facets in a local variable as it is generated on the fly, each time it is accessed.

Points

Returns: A collection of the mesh points; With this attribute it is possible to get access to the points of the mesh: for p in mesh.Points: print p.x, p.y, p.z,p.Index.WARNING! store Points in a local variable as it is generated on the fly, each time it is accessed.

Topology

Returns: the points and face indices as tuple. Topology[0] is a list of all vertices. Each being a tuple of 3 coordinates. Topology[1] is a list of all polygons. Each being a list of vertex indice into Topology[0] WARNING! store Topology in a local variable as it is generated on the fly, each time it is accessed.

Volume

Returns: the volume of the mesh object.

BoundBox

Returns: the BoundBox of the object

Matrix

Returns: the current transformation of the object as matrix

Placement

Returns: the current transformation of the object as placement