Mesh API/it: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
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 [[Mesh Module/it|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:
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 [[Mesh Module/it|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:


Line 11: Line 12:




<div class="mw-translate-fuzzy">
{{APIFunction|addFacet|Facet|Adds a facet to the mesh| }}
{{APIFunction|addFacets|list|Adds a list of facets to the mesh| }}
{{APIFunction|addFacet|Facet|Aggiunge una sfaccettatura alla maglia| }}
{{APIFunction|addMesh|Mesh|Combines this mesh with another mesh.| }}
{{APIFunction|addFacets|list|Aggiunge un elenco di sfaccettature alla maglia| }}
{{APIFunction|clear| |Clears the mesh| }}
{{APIFunction|addMesh|Mesh|Combina questa mesh con un'altra mesh.| }}
{{APIFunction|coarsen| |Coarsens the mesh| }}
{{APIFunction|clear| |Cancella la mesh| }}
{{APIFunction|collapseEdge|Edge|Removes an edge and both facets that share this edge| }}
{{APIFunction|coarsen| |Rende grossolana la mesh| }}
{{APIFunction|collapseEdge|Edge|Rimuove un bordo e entrambe le sfaccettature che condividono questo bordo| }}
{{APIFunction|collapseFacet|Facet|Removes a facet| }}
{{APIFunction|collapseFacets|list|Removes a list of facets| }}
{{APIFunction|collapseFacet|Facet|Rimuove una sfaccettatura| }}
{{APIFunction|copy| |Creates a copy of this mesh|a Mesh object}}
{{APIFunction|collapseFacets|list|Rimuove una seriea di sfaccettature| }}
{{APIFunction|countComponents| |Get the number of topological independent areas|an integer}}
{{APIFunction|copy| |Crea una copia di questa maglia | un oggetto Mesh}}
{{APIFunction|countNonUniformOrientedFacets| |Get the number of wrong oriented facets|an integer}}
{{APIFunction|countComponents| |Ottiene il numero di aree topologiche indipendenti | un intero}}
{{APIFunction|countSegments| |Get the number of segments which may also be 0|an integer}}
{{APIFunction|countNonUniformOrientedFacets| |Ottiene il numero di sfaccettature orientate male | un intero}}
{{APIFunction|crossSections| |Get cross-sections of the mesh through several planes| }}
{{APIFunction|countSegments| |Ottiene il numero di segmenti che possono essere anche 0 | un numero intero}}
{{APIFunction|difference|Mesh|Difference of this and the given mesh object.| }}
{{APIFunction|crossSections| |Ottiene sezioni trasversali della rete attraverso diversi piani| }}
{{APIFunction|fillupHoles| |Fillup holes| }}
{{APIFunction|difference|Mesh|Differenze tra questo oggetto e l'oggetto mesh dato.| }}
{{APIFunction|fixDeformations| |Repair deformed facets| }}
{{APIFunction|fillupHoles| |Riempie i fori| }}
{{APIFunction|fixDegenerations| |Remove degenerated facets| }}
{{APIFunction|fixDeformations| |Ripara le faccette deformate| }}
{{APIFunction|fixIndices| |Repair any invalid indices| }}
{{APIFunction|fixDegenerations| |Rimuove le sfaccettature degenerate| }}
{{APIFunction|fixSelfIntersections| |Repair self-intersections| }}
{{APIFunction|fixIndices| |Ripara eventuali indici non validi| }}
{{APIFunction|flipNormals| |Flip the mesh normals| }}
{{APIFunction|fixSelfIntersections| |Ripara le autointersezioni| }}
{{APIFunction|foraminate| |Get a list of facet indices and intersection points| }}
{{APIFunction|flipNormals| |Inverte le normali delle mesh| }}
{{APIFunction|foraminate| |Ottiene un elenco di indici delle faccette e dei punti di intersezione| }}
{{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|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|getSegment|integer|Get a list of facet indices that describes a segment| }}
{{APIFunction|getSegment|integer|Ottiene un elenco di indici delle faccette che descrivono un segmento| }}
{{APIFunction|getSeparateComponents| |Returns a list containing the different components (separated areas) of the mesh as separate meshes|a list}}
{{APIFunction|getSeparateComponents| |Restituisce una lista contenente le diverse componenti (aree separate) della rete come mesh separate |una lista}}
{{APIFunction|harmonizeNormals| |Adjust wrong oriented facets| }}
{{APIFunction|hasNonManifolds| |Check if the mesh has non-manifolds|a boolean}}
{{APIFunction|harmonizeNormals| |Regola le sfaccettature orientate male| }}
{{APIFunction|hasNonUniformOrientedFacets| |Checks if the mesh has facets with inconsistent orientation| }}
{{APIFunction|hasNonManifolds| |Controlla se la mesh contiene non-manifolds | un booleano}}
{{APIFunction|hasSelfIntersections| |Check if the mesh intersects itself| }}
{{APIFunction|hasNonUniformOrientedFacets| |Verifica se la rete ha dellle sfaccettature con orientamento incoerente| }}
{{APIFunction|inner| |Get the part inside of the intersection| }}
{{APIFunction|hasSelfIntersections| |Controlla se la mesh si interseca| }}
{{APIFunction|insertVertex|Vertex|Inserts a vertex into a facet| }}
{{APIFunction|inner| |Ottiene la parte interna all'intersezione| }}
{{APIFunction|intersect|Mesh|Intersection of this and the given mesh object.| }}
{{APIFunction|insertVertex|Vertex|Inserisce un vertice in una sfaccettatura| }}
{{APIFunction|isSolid| |Check if the mesh is a solid| }}
{{APIFunction|intersect|Mesh|Intersezione tra questo oggetto e l'oggetto mesh dato.| }}
{{APIFunction|meshFromSegment| |Create a mesh from segment| }}
{{APIFunction|isSolid| |Controlla se la mesh è un solido| }}
{{APIFunction|meshFromSegment| |Creare una mesh da un segmento| }}
{{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|Move the point along their normals| }}
{{APIFunction|offset|float|Sposta il punto lungo le sue normali| }}
{{APIFunction|offsetSpecial|float|Move the point along their normals| }}
{{APIFunction|offsetSpecial|float|Sposta il punto lungo le sue normali| }}
{{APIFunction|optimizeEdges| |Optimize the edges to get nicer facets| }}
{{APIFunction|optimizeEdges| |Ottimizza i bordi per ottenere delle faccette migliori| }}
{{APIFunction|optimizeTopology| |Optimize the edges to get nicer facets| }}
{{APIFunction|optimizeTopology| |Ottimizza i bordi per ottenere delle faccette migliori| }}
{{APIFunction|outer| |Get the part outside the intersection| }}
{{APIFunction|outer| |Ottiene la parte al di fuori l'intersezione| }}
{{APIFunction|printInfo| |Get detailed information about the mesh| }}
{{APIFunction|printInfo| |Ottiene informazioni dettagliate sulla 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 78:
{{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 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|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|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|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|Topology|the points and face indices as tuple.}}
{{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|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}}
{{APIProperty|Matrix|the current transformation of the object as matrix}}
{{APIProperty|Matrix|the current transformation of the object as matrix}}
{{APIProperty|Placement|the current transformation of the object as placement}}
{{APIProperty|Placement|the current transformation of the object as placement}}
</div>




[[Category:API/it]]
[[Category:API/it]]

{{clear}}
<languages/>

Revision as of 19:08, 6 August 2018

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: Aggiunge una sfaccettatura alla maglia

Returns:

addFacets(list)

Description: Aggiunge un elenco di sfaccettature alla maglia

Returns:

addMesh(Mesh)

Description: Combina questa mesh con un'altra mesh.

Returns:

clear( )

Description: Cancella la mesh

Returns:

coarsen( )

Description: Rende grossolana la mesh

Returns:

collapseEdge(Edge)

Description: Rimuove un bordo e entrambe le sfaccettature che condividono questo bordo

Returns:

collapseFacet(Facet)

Description: Rimuove una sfaccettatura

Returns:

collapseFacets(list)

Description: Rimuove una seriea di sfaccettature

Returns:

copy( )

Description: Crea una copia di questa maglia

Returns: un oggetto Mesh

countComponents( )

Description: Ottiene il numero di aree topologiche indipendenti

Returns: un intero

countNonUniformOrientedFacets( )

Description: Ottiene il numero di sfaccettature orientate male

Returns: un intero

countSegments( )

Description: Ottiene il numero di segmenti che possono essere anche 0

Returns: un numero intero

crossSections( )

Description: Ottiene sezioni trasversali della rete attraverso diversi piani

Returns:

difference(Mesh)

Description: Differenze tra questo oggetto e l'oggetto mesh dato.

Returns:

fillupHoles( )

Description: Riempie i fori

Returns:

fixDeformations( )

Description: Ripara le faccette deformate

Returns:

fixDegenerations( )

Description: Rimuove le sfaccettature degenerate

Returns:

fixIndices( )

Description: Ripara eventuali indici non validi

Returns:

fixSelfIntersections( )

Description: Ripara le autointersezioni

Returns:

flipNormals( )

Description: Inverte le normali delle mesh

Returns:

foraminate( )

Description: Ottiene un elenco di indici delle faccette e dei punti di intersezione

Returns:

getPlanes( )

Description: 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.

Returns:

getSegment(integer)

Description: Ottiene un elenco di indici delle faccette che descrivono un segmento

Returns:

getSeparateComponents( )

Description: Restituisce una lista contenente le diverse componenti (aree separate) della rete come mesh separate

Returns: una lista

harmonizeNormals( )

Description: Regola le sfaccettature orientate male

Returns:

hasNonManifolds( )

Description: Controlla se la mesh contiene non-manifolds

Returns: un booleano

hasNonUniformOrientedFacets( )

Description: Verifica se la rete ha dellle sfaccettature con orientamento incoerente

Returns:

hasSelfIntersections( )

Description: Controlla se la mesh si interseca

Returns:

inner( )

Description: Ottiene la parte interna all'intersezione

Returns:

insertVertex(Vertex)

Description: Inserisce un vertice in una sfaccettatura

Returns:

intersect(Mesh)

Description: Intersezione tra questo oggetto e l'oggetto mesh dato.

Returns:

isSolid( )

Description: Controlla se la mesh è un solido

Returns:

meshFromSegment( )

Description: Creare una mesh da un segmento

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: Sposta il punto lungo le sue normali

Returns:

offsetSpecial(float)

Description: Sposta il punto lungo le sue normali

Returns:

optimizeEdges( )

Description: Ottimizza i bordi per ottenere delle faccette migliori

Returns:

optimizeTopology( )

Description: Ottimizza i bordi per ottenere delle faccette migliori

Returns:

outer( )

Description: Ottiene la parte al di fuori l'intersezione

Returns:

printInfo( )

Description: Ottiene informazioni dettagliate sulla 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 p in mesh.Facets: print p

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

Topology

Returns: the points and face indices as tuple.

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