﻿ Meshop Edge Methods 亚游ag骗局|官网,ag游戏庄闲|开户,ag赌神赛规则|官网

# Meshop Edge Methods

?

For more mesh-related methods, see

?

Methods:

meshop.chamferEdges

Chamfers the specified edges by the specified amount.

Example:

obj = Box()

convertToMesh obj

meshop.chamferEdges obj #{7,8,11,14,17} 5

update obj

meshop.cloneEdges

Clones the specified edges.

meshop.collapseEdges

Collapses the specified edges.

Example:

obj = Box()

convertToMesh obj

meshop.collapseEdges obj #{14,17}

update obj

meshop.deleteEdges delIsoVerts:

Deletes the specified edges. If is true, any isolated vertices are deleted.

meshop.divideEdge visDiag1: visDiag2: fixNeighbors: split:

Divides the specified edge at a fractional distance of along its length. and specify whether each of the two new edges will be visible. If is true, the face on the other side of this edge, that is, the "reverse face", should be divided as well to prevent the introduction of a seam. If is true, separate vertices for the two halves of the edge will be created, splitting the mesh open along the diagonal(s).

Example:

obj = Box() --create a Box

convertToMesh obj --collapse to EMesh

meshop.divideEdge obj 5 0.33 --divide bottom edge at 1/3

meshop.divideEdge obj 5 0.5 --divide remaining 2/3 at half -> 2 * 1/3

update obj --update the mesh

obj.vertexTicks = True --show the vertices

obj.allEdges=True --show all edges

meshop.divideEdges

Divides all the specified edges in half, creating new points and subdividing faces.

Example:

obj = Box() --create a Box

convertToMesh obj --collapse to EMesh

meshop.divideEdges obj #{5,7,14,17} --divide edges

update obj --update the mesh

obj.vertexTicks = True --show the vertices

obj.allEdges=True --show all edges

meshop.edgeTessellate

Tessellates the specified edges. This algorithm is exactly the one used in the Tessellate modifier, when operating on Faces and Edge SO elements.

specifies the tension for the edge tessellation. This value should be fairly small, between 0 and .5, and corresponds to the value in the Tessellate, Edit Mesh, or Editable Mesh UI's divided by 400.

Example:

obj = Box() --create a Box

convertToMesh obj --collapse to EMesh

meshop.EdgeTessellate obj #{5,6} 0.0 --tessellate faces based on edges

update obj --update the mesh

meshop.extrudeEdges \

dir:<{ | #independent | #common}=#independent> \

node:

Creates new edges corresponding to the specified edges, and then moves the new edges by . The direction the edges are moved is determined by

. If is a point3 value, the edges will be moved in that direction. (If is a node, or if is an Editable Mesh or a Mesh value and is specified, the direction is in the current coordinate system context. If is an Editable Mesh or a Mesh value and is not specified, the direction is in the mesh's local coordinate system.) If dir:#independent is specified, the edges are moved based on the normals of the faces using the edge. If dir:#common is specified, the edges are moved based on the normals of the face clusters using the edge.

Example:

obj = Box() --create a Box

convertToMesh obj --collapse to EMesh

meshop.extrudeEdges obj #{5,7,14,17} 10.0 --extrude edges

update obj --update the mesh

addmodifier obj (normalmodifier unify:true) --unify normals

convertToMesh obj --collapse to EMesh

meshop.getEdgesUsingVert

Returns a bitarray of size=(#edges in mesh) with bits set for all edges that use the specified vertices.

Script:

macroScript Vert2EdgeSel category:"MXS Help"

(

--make sure a single EMesh object is selected

on isEnabled return selection.count == 1 and classof selection[1] == Editable_Mesh

on execute do

(

obj = selection[1] --get selected object

vertsSel = getVertSelection obj --get selected Verts

--get Edges of selected Verts:

edgeSel = meshop.getEdgesUsingVert obj vertsSel

setEdgeSelection obj edgeSel --select the edges

max modify mode --switch to Modify panel

subObjectLevel =2 --set Edge SO level

)

)--end macro

?

?

meshop.getOpenEdges

Returns a bitarray of size=(#edges in mesh) with bits set for all edges that are used by a single face.

Script:

macroScript SelOpenEdges category:"MXS Help"

(

--make sure a single EMesh object is selected

on isEnabled return selection.count == 1 and classof selection[1] == Editable_Mesh

on execute do

(

obj = selection[1] --get selected object

max modify mode --switch to Modify panel

subObjectLevel =2 --set Edge SO level

openEdges = meshop.getOpenEdges obj --get open edges

setEdgeSelection obj openEdges --select the open edges

)

)--end macro

?

?

meshop.turnEdge

Turns the specified edge. Only works on edges that have a face on both sides. These two faces are considered as a quad, where this edge is the diagonal, and remapped so that the diagonal flows the other way, between the vertices that were opposite this edge on each face.

meshop.getVertsUsingEdge

Returns a bitarray of size=(#vertices in mesh) with bits set for all vertices that are used by the specified edges.

Script:

macroScript Edge2VertSel category:"MXS Help"

(

--make sure a single EMesh object is selected

on isEnabled return selection.count == 1 and classof selection[1] == Editable_Mesh

on execute do

(

obj = selection[1] --get selected object

edgeSel = getEdgeSelection obj --get selected Edges

--get Verts of selected Edges:

vertsSel = meshop.getVertsUsingEdge obj edgeSel

setVertSelection obj vertsSel --select the Verts

max modify mode --switch to Modify panel

subObjectLevel =1 --set Vertex SO level

)--end on

)--end macro

?

meshop.getFacesUsingEdge

Returns a bitarray of size=(#faces in mesh) with bits set for all faces that use the specified edges.

Script:

macroScript Edge2FaceSel category:"MXS Help"

(

--make sure a single EMesh object is selected

on isEnabled return selection.count == 1 and classof selection[1] == Editable_Mesh

on execute do

(

obj = selection[1] --get selected object

edgeSel = getEdgeSelection obj --get selected Edges

--get Faces of selected Edges:

faceSel = meshop.getFacesUsingEdge obj edgeSel

setFaceSelection obj faceSel --select the Faces

max modify mode --switch to Modify panel

subObjectLevel =3 --set Face SO level

)--end on

)--end macro

?

meshop.getPolysUsingEdge ignoreVisEdges: threshhold:

Returns a bitarray of size=(#faces in mesh) with bits set for all faces that are in 'polygons' containing the specified edges. The definition of a polygon is all faces sharing invisible edges with edge angles below the threshhold angle. The default threshhold angle is 45 degrees. If ignoreVisEdges is set to true, the edge visibility is ignored but the threshhold is still relevant.

Script:

macroScript Edge2PolySel category:"MXS Help"

(

--make sure a single EMesh object is selected

on isEnabled return selection.count == 1 and classof selection[1] == Editable_Mesh

on execute do

(

obj = selection[1] --get selected object

edgeSel = getEdgeSelection obj --get selected Edges

--get Polygons of selected Edges:

faceSel = meshop.getPolysUsingEdge obj edgeSel

setFaceSelection obj faceSel --select the Faces

max modify mode --switch to Modify panel

subObjectLevel =4 --set Polygon SO level

)--end on

)--end macro

?

meshop.getEdgesReverseEdge

Returns a bitarray of size=(#edges in mesh) with bits set for all additional edges that use the same vertices as the specified edges. These are edges on the adjacent faces.

Example:

Plane length:100 width:100 isSelected:on

convertTo \$ TriMeshGeometry

?

max modify mode

subobjectLevel = 1

select \$.verts[13]

?

--?get edges that use vertex 13

edges = meshop.getEdgesUsingVert \$ (getVertSelection \$)

?

--?select the vertices used by those edges

\$.selectedVerts = meshop.getVertsUsingEdge \$ edges

update \$

?

--?not what we wanted, really want all vertices "surrounding" vertex 13

faces = meshop.getPolysUsingVert \$ 13

\$.selectedVerts = meshop.getVertsUsingFace \$ faces

update \$

?

--?or ...

faces = meshop.getFacesUsingVert \$ #(13)

edges = meshop.getEdgesUsingFace \$ faces

?

--?turn off all visible edges

for e in edges do edges[e]=not (getEdgeVis \$ (1+(e-1)/3)(1+mod (e-1) 3))

?

--?get the edges on the adjacent faces that are the "reverse" of these edges

?

--?"OR" that bitarray with the initial edges bitarray

edges = (meshop.getEdgesReverseEdge \$ edges) + edges

?

--?get the faces that use the edges, and "OR" that bitarray with the initial

?

--?face bitarray

faces = (meshop.getFacesUsingEdge \$ edges) + faces

\$.selectedVerts = meshop.getVertsUsingFace \$ faces

update \$

?

meshop.autoEdge \

type:<{#SetClear | #Set | #Clear}=#SetClear>

Sets/clears the edge visibility for the specified edges based on the threshold angle.

Note:

For an edge to be autoEdged, both it and the "reverse" edge on the face sharing the same vertices must be specified in the edge specification.

?