本文整理匯總了TypeScript中math/polyhedra.Polyhedron.numVertices方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Polyhedron.numVertices方法的具體用法?TypeScript Polyhedron.numVertices怎麽用?TypeScript Polyhedron.numVertices使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類math/polyhedra.Polyhedron
的用法示例。
在下文中一共展示了Polyhedron.numVertices方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
_.forEach(edge.vertices, (v, j) => {
_.set(
newVertexMapping,
[oppositeFace.index, v.index],
polyhedron.numVertices() + ((i + j) % boundary.numSides),
);
});
示例2: duplicateVertices
function duplicateVertices(polyhedron: Polyhedron, facesTosharpen: Face[]) {
const offset = polyhedron.numVertices();
const mapping: NestedRecord<number, number, any> = {};
_.forEach(polyhedron.vertices, vertex => {
const v = vertex.index;
const v2 = v + offset;
const values = [v, [v2, v], v2, [v, v2]];
const faces = getShiftedAdjacentFaces(vertex, facesTosharpen);
_.forEach(faces, (f, i) => {
_.set(mapping, [f.index, v], values[i]);
});
});
// Double the amount of vertices
return polyhedron.withChanges(solid =>
solid.addVertices(polyhedron.vertices).mapFaces(f => {
return _.flatMapDeep(f.vertices, v => mapping[f.index][v.index]);
}),
);
}
示例3:
return face.vertices.map(v => {
return v.inSet(boundary.vertices)
? polyhedron.numVertices() + oldToNew[v.index]
: v.index;
});