本文整理汇总了Python中testing.setup_mesh_modifier_test函数的典型用法代码示例。如果您正苦于以下问题:Python setup_mesh_modifier_test函数的具体用法?Python setup_mesh_modifier_test怎么用?Python setup_mesh_modifier_test使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setup_mesh_modifier_test函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyGrid", "DissolveFaces")
selection = k3d.selection.set()
primitive_selection = k3d.geometry.primitive_selection.create(selection, k3d.selection.type.FACE)
k3d.geometry.primitive_selection.append(primitive_selection, 0, 2, 1)
k3d.geometry.primitive_selection.append(primitive_selection, 11, 15, 1)
setup.modifier.mesh_selection = selection
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "modifier.DissolveFaces", 2)
示例2:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCube", "GTSMeshVolume")
setup.source.width = 2
setup.source.height = 3
setup.source.depth = 4
testing.require_mesh_volume(setup.modifier.volume, 24.0)
示例3:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyGrid", "GrowSelection")
selection = k3d.geometry.selection.create(0)
point_selection = k3d.geometry.point_selection.create(selection)
k3d.geometry.point_selection.append(point_selection, 15, 16, 1)
k3d.geometry.point_selection.append(point_selection, 18, 19, 1)
edge_selection = k3d.geometry.primitive_selection.create(selection, k3d.selection.type.EDGE)
k3d.geometry.primitive_selection.append(edge_selection, 17, 18, 1)
k3d.geometry.primitive_selection.append(edge_selection, 55, 56, 1)
face_selection = k3d.geometry.primitive_selection.create(selection, k3d.selection.type.FACE)
k3d.geometry.primitive_selection.append(face_selection, 12, 13, 1)
setup.modifier.mesh_selection = selection
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.selection.GrowSelection", 2)
示例4:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCube", "TriangulateFaces")
mesh_selection = k3d.geometry.selection.create(1)
setup.modifier.mesh_selection = mesh_selection
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.TriangulateFaces.PolyCube", 0)
示例5:
# python
import testing
import k3d
setup = testing.setup_mesh_modifier_test("NurbsDisk", "NurbsExtrudePatch")
setup.modifier.mesh_selection = k3d.geometry.selection.create(1)
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(
setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.NurbsExtrudePatch", 2, ["Darwin-i386"]
)
示例6:
# python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCylinder", "LinearWavePoints")
selection = k3d.geometry.selection.create(0)
selection.points = k3d.geometry.point_selection.create(selection, 1)
setup.source.u_segments = 4
setup.source.v_segments = 16
setup.modifier.mesh_selection = selection
setup.modifier.axis = "x"
setup.modifier.along = "z"
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(
setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.LinearWavePoints", 1, ["Darwin-i386"]
)
示例7:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCylinder", "TaperPoints")
selection = k3d.geometry.selection.create(0)
selection.points = k3d.geometry.point_selection.create(selection, 1)
setup.modifier.mesh_selection = selection
setup.modifier.taper_factor = 1
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.TaperPoints", 4, ["Darwin-i386"])
示例8:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("NurbsCircle","NurbsPolygonizeCurve")
setup.modifier.mesh_selection = k3d.geometry.selection.create(1)
setup.modifier.segments = 10
setup.modifier.delete_original = True
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.NurbsPolygonizeCurve", 3, ["Darwin-i386"])
示例9:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("FrozenMesh", "TriangulateFaces")
mesh = setup.source.create_mesh()
points = mesh.create_points()
point_selection = mesh.create_point_selection()
polyhedron = k3d.polyhedron.create(mesh)
Cs = polyhedron.vertex_attributes().create("Cs", "k3d::color")
positions = [(0, 0, 1), (1, 0, 1), (2, 0, 0), (2, 0, 1), (1, 0, 0), (0, 0, 0)]
for position in positions:
points.append(k3d.point3(position[0], position[1], position[2]))
point_selection.append(0)
polyhedron.shell_types().append(k3d.polyhedron.shell_type.POLYGONS)
polyhedron.face_shells().append(0)
polyhedron.face_first_loops().append(len(polyhedron.loop_first_edges()))
polyhedron.face_loop_counts().append(1)
polyhedron.face_materials().append(None)
polyhedron.face_selections().append(0)
polyhedron.loop_first_edges().append(len(polyhedron.clockwise_edges()))
polyhedron.clockwise_edges().append(1)
示例10:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCube", "CUDATransformPoints")
selection = k3d.geometry.selection.create(0)
selection.points = k3d.geometry.point_selection.uniform(selection, 1)
setup.modifier.mesh_selection = selection
setup.modifier.input_matrix = k3d.translate3(k3d.vector3(0, 0, 1))
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.TransformPoints", 1)
示例11:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyGrid", "ScalePoints")
setup.source.rows = 1
setup.source.columns = 1
mesh_selection = k3d.geometry.selection.create(1.0)
setup.modifier.mesh_selection = mesh_selection
setup.modifier.x = 2
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.selection.all", 1)
示例12:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyText", "CapHoles")
selection = k3d.geometry.selection.create(0)
edge_selection = k3d.geometry.primitive_selection.create(selection, k3d.selection.type.EDGE)
k3d.geometry.primitive_selection.append(edge_selection, 48, 49, 1)
setup.source.text = "8"
setup.modifier.mesh_selection = selection
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.CapHoles", 2, ["Darwin-i386"])
示例13:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCube", "PointsToParticles")
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.PointsToParticles", 1)
示例14:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyGrid", "SelectBoundaryEdges")
setup.modifier.mesh_selection = k3d.geometry.selection.create(0)
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.selection.SelectBoundaryEdges", 1)
示例15:
# python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCube", "SphereizePoints")
setup.source.rows = 2
setup.source.columns = 2
setup.source.slices = 2
selection = k3d.geometry.selection.create(0)
selection.points = k3d.geometry.point_selection.create(selection, 1)
setup.modifier.mesh_selection = selection
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(
setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.SphereizePoints", 1
)