本文整理汇总了Python中testing.require_valid_mesh函数的典型用法代码示例。如果您正苦于以下问题:Python require_valid_mesh函数的具体用法?Python require_valid_mesh怎么用?Python require_valid_mesh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了require_valid_mesh函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyGrid", "CollapseFaces")
selection = k3d.selection.set()
primitive_selection = k3d.geometry.primitive_selection.create(selection, k3d.selection.type.FACE)
k3d.geometry.primitive_selection.append(primitive_selection, 0, 1, 1)
k3d.geometry.primitive_selection.append(primitive_selection, 13, 14, 1)
k3d.geometry.primitive_selection.append(primitive_selection, 17, 18, 1)
k3d.geometry.primitive_selection.append(primitive_selection, 19, 20, 1)
k3d.geometry.primitive_selection.append(primitive_selection, 23, 24, 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.CollapseFaces", 2)
示例2: file
#python
import k3d
import testing
script_path = k3d.share_path() / k3d.filesystem.generic_path("scripts/MeshSourceScript/bezier_triangle_patches.py")
script_file = file(str(script_path), "r")
setup = testing.setup_mesh_source_test("MeshSourceScript")
setup.source.script = script_file.read()
testing.require_valid_mesh(setup.document, setup.source.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.source.get_property("output_mesh"), "mesh.source.MeshSourceScript.bezier_triangle_patches", 2)
示例3: str
#python
import k3d
import testing
import benchmarking
document = k3d.new_document()
sphere = k3d.plugin.create("PolySphere", document)
torus = k3d.plugin.create("PolyTorus", document)
carve_boolean = k3d.plugin.create("CARVEBoolean", document)
k3d.property.create(carve_boolean, "k3d::mesh*", "input_1", "Input 1", "")
k3d.property.create(carve_boolean, "k3d::mesh*", "input_2", "Input 2", "")
k3d.property.connect(document, sphere.get_property("output_mesh"), carve_boolean.get_property("input_1"))
k3d.property.connect(document, torus.get_property("output_mesh"), carve_boolean.get_property("input_2"))
profiler = k3d.plugin.create("PipelineProfiler", document)
testing.require_valid_mesh(document, carve_boolean.get_property("output_mesh"))
testing.require_similar_mesh(document, carve_boolean.get_property("output_mesh"), "mesh.modifier.CARVEBoolean.benchmark", 1)
benchmarking.print_profiler_records(profiler.records)
print """<DartMeasurement name="Total Boolean Time" type="numeric/float">""" + str(benchmarking.total_profiler_time(profiler.records)) + """</DartMeasurement>"""
示例4:
import testing
import k3d
document = k3d.new_document()
patch = k3d.plugin.create("NurbsGrid", document)
curve = k3d.plugin.create("NurbsCircle", document)
merge_mesh = k3d.plugin.create("MergeMesh", document)
modifier = k3d.plugin.create("NurbsAddTrimCurve", document)
extract_trim = k3d.plugin.create("NurbsExtractTrimCurves", document)
k3d.property.create(merge_mesh, "k3d::mesh*", "input_mesh1", "Input Mesh 1", "")
k3d.property.create(merge_mesh, "k3d::mesh*", "input_mesh2", "Input Mesh 2", "")
modifier.mesh_selection = k3d.geometry.selection.create(1)
modifier.offset_u = 0.5
modifier.offset_v = 0.5
modifier.delete_curve = True
extract_trim.mesh_selection = k3d.geometry.selection.create(1)
k3d.property.connect(document, patch.get_property("output_mesh"), merge_mesh.get_property("input_mesh1"))
k3d.property.connect(document, curve.get_property("output_mesh"), merge_mesh.get_property("input_mesh2"))
k3d.property.connect(document, merge_mesh.get_property("output_mesh"), modifier.get_property("input_mesh"))
k3d.property.connect(document, modifier.get_property("output_mesh"), extract_trim.get_property("input_mesh"))
testing.require_valid_mesh(document, extract_trim.get_property("output_mesh"))
testing.require_similar_mesh(document, extract_trim.get_property("output_mesh"), "mesh.modifier.NurbsExtractTrimCurves", 10)
示例5:
#python
import k3d
import testing
document = k3d.new_document()
source1 = k3d.plugin.create("PolyCube", document)
source2 = k3d.plugin.create("PolyCube", document)
merge = k3d.plugin.create("MergeMesh", document)
k3d.property.create(merge, "k3d::mesh*", "input_mesh1", "Input Mesh 1", "")
k3d.property.create(merge, "k3d::mesh*", "input_mesh2", "Input Mesh 2", "")
k3d.property.connect(document, source1.get_property("output_mesh"), merge.get_property("input_mesh1"))
k3d.property.connect(document, source1.get_property("output_mesh"), merge.get_property("input_mesh2"))
weld = k3d.plugin.create("WeldPoints", document)
weld.distance = 0.5
k3d.property.connect(document, merge.get_property("output_mesh"), weld.get_property("input_mesh"))
testing.require_valid_mesh(document, weld.get_property("output_mesh"))
testing.require_similar_mesh(document, weld.get_property("output_mesh"), "mesh.modifier.WeldPoints", 1)