当前位置: 首页>>代码示例>>Python>>正文


Python testing.require_similar_mesh函数代码示例

本文整理汇总了Python中testing.require_similar_mesh函数的典型用法代码示例。如果您正苦于以下问题:Python require_similar_mesh函数的具体用法?Python require_similar_mesh怎么用?Python require_similar_mesh使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了require_similar_mesh函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


注:本文中的testing.require_similar_mesh函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。