本文整理汇总了Python中testing.require_similar_mesh函数的典型用法代码示例。如果您正苦于以下问题:Python require_similar_mesh函数的具体用法?Python require_similar_mesh怎么用?Python require_similar_mesh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了require_similar_mesh函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("NurbsCircle","NurbsEditCurveKnotVector")
selection = k3d.geometry.selection.create(0)
curve_selection = k3d.geometry.primitive_selection.create(selection, k3d.selection.type.CURVE)
k3d.geometry.primitive_selection.append(curve_selection, 0, 10000, 1)
setup.modifier.mesh_selection = selection
setup.modifier.knot_vector = [0, 0, 0, 0.1, 0.2, 0.25, 0.3, 0.3, 0.8, 0.8, 1, 1, 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.NurbsEditKnotVector", 1, ["Darwin-i386"])
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:16,代码来源:mesh.modifier.NurbsEditKnotVector1.py
示例2: file
#python
import k3d
import testing
script_path = k3d.share_path() / k3d.filesystem.generic_path("scripts/MeshSourceScript/paraboloids.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.paraboloids", 2)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:14,代码来源:mesh.source.MeshSourceScript.paraboloids.py
示例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>"""
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:24,代码来源:mesh.modifier.CARVEBoolean.benchmark.py
示例4:
#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)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:24,代码来源:mesh.selection.GrowSelection.py
示例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)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:22,代码来源:modifier.WeldPoints.py
示例6:
#python
import testing
setup = testing.setup_mesh_source_test("QuadricSphere")
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.QuadricSphere", 1)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:9,代码来源:mesh.source.QuadricSphere.py
示例7:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCube", "ConnectVertices")
selection = k3d.selection.set()
point_selection = k3d.geometry.point_selection.create(selection)
k3d.geometry.point_selection.append(point_selection, 0, 1, 1)
k3d.geometry.point_selection.append(point_selection, 2, 3, 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.ConnectVertices", 1)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:17,代码来源:mesh.modifier.ConnectVertices.py
示例8:
#python
import k3d
import testing
setup = testing.setup_mesh_writer_test(["PolyCube", "TriangulateFaces", "STLMeshWriter"], "STLMeshReader", "mesh.sink.STLMeshWriter.magics.stl")
setup.modifier.mesh_selection = k3d.geometry.selection.create(1)
setup.writer.file_type = "magics"
testing.require_valid_mesh(setup.document, setup.reader.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.reader.get_property("output_mesh"), "mesh.sink.STLMeshWriter.magics", 1)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:11,代码来源:mesh.sink.STLMeshWriter.magics.py
示例9:
#python
import testing
setup = testing.setup_mesh_source_test("SurfacePlot")
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.SurfacePlot", 8192)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:8,代码来源:mesh.source.SurfacePlot.py
示例10:
document = k3d.new_document()
small_cylinder = k3d.plugin.create("PolyCylinder", document)
small_cylinder.radius = 2.0
small_cylinder.zmax = 7.5
small_cylinder.zmin = -7.5
small_cylinder.u_segments = 8
big_cylinder = k3d.plugin.create("PolyCylinder", document)
big_cylinder.u_segments = 8
torus = k3d.plugin.create("PolyTorus", document)
torus.u_segments = 8
torus.v_segments = 4
first_boolean = k3d.plugin.create("CARVEBoolean", document)
first_boolean.type = "difference"
k3d.property.create(first_boolean, "k3d::mesh*", "input_1", "Input 1", "")
k3d.property.create(first_boolean, "k3d::mesh*", "input_2", "Input 2", "")
second_boolean = k3d.plugin.create("CARVEBoolean", document)
second_boolean.type = "reverse_difference"
k3d.property.create(second_boolean, "k3d::mesh*", "input_1", "Input 1", "")
k3d.property.create(second_boolean, "k3d::mesh*", "input_2", "Input 2", "")
k3d.property.connect(document, big_cylinder.get_property("output_mesh"), first_boolean.get_property("input_1"))
k3d.property.connect(document, small_cylinder.get_property("output_mesh"), first_boolean.get_property("input_2"))
k3d.property.connect(document, torus.get_property("output_mesh"), second_boolean.get_property("input_1"))
k3d.property.connect(document, first_boolean.get_property("output_mesh"), second_boolean.get_property("input_2"))
testing.require_valid_mesh(document, second_boolean.get_property("output_mesh"))
testing.require_similar_mesh(document, second_boolean.get_property("output_mesh"), "mesh.modifier.CARVEBoolean.cylinders", 1)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:30,代码来源:mesh.modifier.CARVEBoolean.cylinders.py
示例11:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyGrid", "CatmullClark")
testing.add_point_attributes_test(setup, True, False, False)
setup.source.u_segments = 4
setup.source.v_segments = 2
setup.source.bottom = False
setup.modifier.mesh_selection = k3d.geometry.selection.create(1)
testing.require_valid_mesh(setup.document, setup.modifier.get_property("output_mesh"))
#testing.require_valid_point_attributes(setup.document, setup.modifier.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier.get_property("output_mesh"), "mesh.modifier.CatmullClark", 2)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:17,代码来源:mesh.modifier.CatmullClark.py
示例12:
#python
import testing
setup = testing.setup_mesh_reader_test("3DSMeshReader", "mesh.source.3DSMeshReader.test.3ds")
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.3DSMeshReader.test", 1)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:8,代码来源:mesh.source.3DSMeshReader.py
示例13:
#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"])
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:15,代码来源:mesh.modifier.TaperPoints.py
示例14:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test2("PolyCube", "TranslatePoints", "CenterPoints")
selection = k3d.geometry.selection.create(0)
selection.points = k3d.geometry.point_selection.create(selection, 1)
setup.modifier1.mesh_selection = selection
setup.modifier1.x = 1.0
setup.modifier1.y = 2.0
setup.modifier1.z = 3.0
setup.modifier2.mesh_selection = selection
setup.modifier2.center_x = True
setup.modifier2.center_y = True
setup.modifier2.center_z = True
testing.require_valid_mesh(setup.document, setup.modifier2.get_property("output_mesh"))
testing.require_similar_mesh(setup.document, setup.modifier2.get_property("output_mesh"), "mesh.modifier.CenterPoints", 1)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:23,代码来源:mesh.modifier.CenterPoints.py
示例15:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCube", "PolyToBilinear")
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.PolyToBilinear", 1)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:10,代码来源:modifier.PolyToBilinear.py
示例16:
#python
import testing
import k3d
setup = testing.setup_mesh_modifier_test("NurbsCircle", "NurbsCurveInsertKnot")
setup.modifier.u_value = 0.1
selection = k3d.geometry.selection.create(0)
curve_selection = k3d.geometry.primitive_selection.create(selection, k3d.selection.type.CURVE)
k3d.geometry.primitive_selection.append(curve_selection, 0, 10000, 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.NurbsCurveInsertKnot", 2, ["Darwin-i386"])
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:16,代码来源:mesh.modifier.NurbsCurveInsertKnot.py
示例17:
#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)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:13,代码来源:mesh.modifier.TriangulateFaces.PolyCube.py
示例18:
#Create a polycube
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").panel("NGUIToolbarPanel").filler(0).panel(0).filler(0).filler(0).page_tab_list(0).page_tab("Create").filler(0).filler(0).push_button(0).click()
# Switch to point selection mode
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").panel("NGUIToolbarPanel").filler("vbox").panel("content").filler("vbox").filler("toolbox").filler("main_toolbar").filler("row1").toggle_button("Select Nodes").click()
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").panel("NGUIToolbarPanel").filler("vbox").panel("content").filler("vbox").filler("toolbox").filler("main_toolbar").filler("row1").toggle_button("Select Points").click()
doc = k3d.documents()[0]
cube_instance = k3d.node.lookup_one(doc, "PolyCube Instance")
# set the selection on the PolyCube instance
selection = k3d.geometry.selection.create(0)
point_selection = k3d.geometry.point_selection.create(selection)
k3d.geometry.point_selection.append(point_selection, 0, 4, 1)
cube_instance.mesh_selection = selection
# Switch to move tool
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").panel("NGUIToolbarPanel").filler("vbox").panel("content").filler("vbox").filler("toolbox").filler("main_toolbar").filler("row0").toggle_button("selection_tool").click()
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").panel("NGUIToolbarPanel").filler("vbox").panel("content").filler("vbox").filler("toolbox").filler("main_toolbar").filler("row0").toggle_button("move_tool").click()
# Activate the move tool properties and change the parameters
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").split_pane("bottom").split_pane("top").split_pane("left").split_pane("bottom").panel("NGUINodePropertiesPanel").filler("vbox").filler("decorations").combo_box("panel_type").menu(0).menu_item("NGUIToolPropertiesPanel").click()
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").split_pane("bottom").split_pane("top").split_pane("left").split_pane("bottom").panel("NGUIToolPropertiesPanel").filler("vbox").panel("content").filler(0).filler("vbox").scroll_pane(0).viewport(0).filler("move_tool").panel("Builtin Properties").panel(0).panel("move_control").panel(2).push_button("up").click()
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").split_pane("bottom").split_pane("top").split_pane("left").split_pane("bottom").panel("NGUIToolPropertiesPanel").filler("vbox").panel("content").filler(0).filler("vbox").scroll_pane(0).viewport(0).filler("move_tool").panel("Builtin Properties").panel(0).panel("move_control").panel(2).push_button("up").click()
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").split_pane("bottom").split_pane("top").split_pane("left").split_pane("bottom").panel("NGUIToolPropertiesPanel").filler("vbox").panel("content").filler(0).filler("vbox").scroll_pane(0).viewport(0).filler("move_tool").panel("Builtin Properties").panel(0).panel("move_control").panel(2).push_button("up").click()
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").split_pane("bottom").split_pane("top").split_pane("left").split_pane("bottom").panel("NGUIToolPropertiesPanel").filler("vbox").panel("content").filler(0).filler("vbox").scroll_pane(0).viewport(0).filler("move_tool").panel("Builtin Properties").panel(0).panel("move_control").panel(2).push_button("up").click()
k3d.atk.root().frame("Untitled Document 1").filler("vbox").panel("main").split_pane("main").split_pane("bottom").split_pane("top").split_pane("left").split_pane("bottom").panel("NGUIToolPropertiesPanel").filler("vbox").panel("content").filler(0).filler("vbox").scroll_pane(0).viewport(0).filler("move_tool").panel("Builtin Properties").panel(0).panel("move_control").panel(2).push_button("up").click()
tweakpoints = k3d.node.lookup_one(doc, "Move PolyCube Instance components")
testing.require_similar_mesh(doc, tweakpoints.get_property("output_mesh"), "ngui.tools.move", 1)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:30,代码来源:MoveTool.py
示例19:
#python
import k3d
import testing
setup = testing.setup_mesh_modifier_test("PolyCube", "MeshArray2D")
setup.modifier.layout = k3d.plugin.create("TranslateArray2D", setup.document)
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.MeshArray2D", 1)
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:11,代码来源:mesh.modifier.MeshArray2D.py
示例20:
curve1 = k3d.plugin.create("NurbsCircle", document)
curve2 = k3d.plugin.create("NurbsCircle", document)
transform = k3d.plugin.create("TranslatePoints", document)
merge_mesh = k3d.plugin.create("MergeMesh", document)
modifier = k3d.plugin.create("NurbsMergeCurveKnotVectors", document)
curve2.thetamax = math.radians(180)
curve2.u_segments = 6
k3d.property.create(merge_mesh, "k3d::mesh*", "input_mesh1", "Input Mesh 1", "")
k3d.property.create(merge_mesh, "k3d::mesh*", "input_mesh2", "Input Mesh 2", "")
transform_selection = k3d.geometry.selection.create(0)
k3d.geometry.point_selection.create(transform_selection, 1)
transform.mesh_selection = transform_selection
transform.z = 3
selection = k3d.geometry.selection.create(0)
curve_selection = k3d.geometry.primitive_selection.create(selection, k3d.selection.type.CURVE)
k3d.geometry.primitive_selection.append(curve_selection, 0, 10000, 1)
modifier.mesh_selection = selection
k3d.property.connect(document, curve2.get_property("output_mesh"), transform.get_property("input_mesh"))
k3d.property.connect(document, curve1.get_property("output_mesh"), merge_mesh.get_property("input_mesh1"))
k3d.property.connect(document, transform.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"))
testing.require_valid_mesh(document, modifier.get_property("output_mesh"))
testing.require_similar_mesh(document, modifier.get_property("output_mesh"), "mesh.modifier.NurbsMergeCurveKnotVectors", 2, ["Darwin-i386"])
开发者ID:AwesomeDoesIt,项目名称:k3d,代码行数:29,代码来源:mesh.modifier.NurbsMergeCurveKnotVectors.py
注:本文中的testing.require_similar_mesh函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论