本文整理匯總了TypeScript中math/geom.withOrigin函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript withOrigin函數的具體用法?TypeScript withOrigin怎麽用?TypeScript withOrigin使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了withOrigin函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: return
return (vector, vertex) => {
const smallFace = find(vertex.adjacentFaces(), {
numSides: 6,
});
const normal = smallFace.withPolyhedron(polyhedron).normal();
const transform = withOrigin(smallFace.centroid(), v =>
v
.scale(faceResizeScale)
.add(normal.scale(normalizedResizeAmount * newSideLength)),
);
return transform(vector);
};
示例2: withOrigin
p =>
withOrigin(p.normalRay(), v => v.getRotatedAroundAxis(p.normal(), theta)),
示例3: withOrigin
return getTransformedVertices<VEList>(vertexSets, set =>
withOrigin(set.normalRay(), v =>
v
.add(set.normal().scale(scale * multiplier))
.getRotatedAroundAxis(set.normal(), angle * multiplier),
),
示例4: getTransformedVertices
const endVertices = getTransformedVertices(faces, f =>
withOrigin(polyhedron.centroid(), v => v.scale(scale))(f.centroid()),
示例5: getTransformedVertices
return getTransformedVertices(faces, f =>
withOrigin(f.centroid(), v =>
v.getRotatedAroundAxis(f.normal(), angle).add(f.normal().scale(scale)),
),