#python import testing setup = testing.setup_mesh_reader_test("GTSMeshReader", "mesh.source.GTSMeshReader.cube.gts") 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.GTSMeshReader.cube", 1)
#python import testing import k3d factories = k3d.plugin.factory.lookup() failing_mesh_readers = "" for factory in factories: if "MeshReader" in factory.categories(): try: setup = testing.setup_mesh_reader_test( factory.name(), "mesh.source.MeshReaders.bogus_input") mesh = setup.reader.output_mesh except: failing_mesh_readers += factory.name() + " " if len(failing_mesh_readers) > 0: raise Exception(failing_mesh_readers + "failed to load a bogus input")
#python import testing setup = testing.setup_mesh_reader_test("SVGMeshReader", "mesh.source.SVGMeshReader.svg") 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.SVGMeshReader", 4)
#python import testing import k3d document = k3d.new_document() setup = testing.setup_mesh_reader_test("K3DMeshReader","mesh.modifier.NurbsCurveTraversalReference.k3d") modifier = setup.document.new_node("NurbsCurveTraversal") modifier.create_caps = True modifier.delete_original = False document.set_dependency(modifier.get_property("input_mesh"), setup.reader.get_property("output_mesh")) testing.mesh_comparison_to_reference(document, modifier.get_property("output_mesh"), "mesh.modifier.NurbsCurveTraversal2", 1)
#python import testing import k3d document = k3d.new_document() setup = testing.setup_mesh_reader_test("K3DMeshReader","mesh.modifier.NurbsCloseCurveReference.k3d") selection = k3d.mesh_selection.deselect_all() component_selection = k3d.mesh_selection.component(0, 1, k3d.selection.type.UNIFORM, 0, 1000, 1) selection.add_component(component_selection) modifier = setup.document.new_node("NurbsCloseCurve") modifier.mesh_selection = selection modifier.keep_ends = False document.set_dependency(modifier.get_property("input_mesh"), setup.reader.get_property("output_mesh")) testing.mesh_comparison_to_reference(document, modifier.get_property("output_mesh"), "mesh.modifier.NurbsCloseCurve1", 1)
#python import testing import k3d document = k3d.new_document() setup = testing.setup_mesh_reader_test( "K3DMeshReader", "mesh.modifier.NurbsCurveInsertKnotReference.k3d") modifier = setup.document.new_node("NurbsCurveInsertKnot") modifier.u_value = 0.742 modifier.multiplicity = 2 modifier.normalize_all = False document.set_dependency(modifier.get_property("input_mesh"), setup.reader.get_property("output_mesh")) testing.mesh_comparison_to_reference(document, modifier.get_property("output_mesh"), "mesh.modifier.NurbsCurveInsertKnot", 1)
#python import testing setup = testing.setup_mesh_reader_test("STLMeshReader", "mesh.source.STLMeshReader.stl") testing.mesh_comparison_to_reference(setup.document, setup.reader.get_property("output_mesh"), "mesh.source.STLMeshReader", 1)
#python import testing setup = testing.setup_mesh_reader_test("COLLADAMeshReader", "mesh.source.COLLADAMeshReader.duck.dae") 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.COLLADAMeshReader.duck", 1)
#python import testing setup = testing.setup_mesh_reader_test("MD2MeshReader", "mesh.source.MD2MeshReader.md2") 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.MD2MeshReader", 1)
#python import testing setup = testing.setup_mesh_reader_test("STLMeshReader", "mesh.source.STLMeshReader.viscam.stl") 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.STLMeshReader.viscam", 1)
#python import testing setup = testing.setup_mesh_reader_test("OBJMeshReader", "mesh.source.OBJMeshReader.polyhedron.obj") 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.OBJMeshReader.polyhedron", 1)
#python import testing setup = testing.setup_mesh_reader_test("PLYMeshReader", "mesh.source.PLYMeshReader.ply") 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.PLYMeshReader", 1)
#python import testing setup = testing.setup_mesh_reader_test("STLMeshReader", "mesh.source.STLMeshReader.magics.stl") 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.STLMeshReader.magics", 1)
#python import testing import k3d factories = k3d.plugin.factory.lookup() for factory in factories: if "MeshReader" in factory.categories(): print "\n\nTesting " + factory.name() + " with a file containing all zeroes ..." setup = testing.setup_mesh_reader_test(factory.name(), "zero_bytes") mesh = setup.source.output_mesh print "\n\nTesting " + factory.name() + " with a file containing random data ..." setup = testing.setup_mesh_reader_test(factory.name(), "random_bytes") mesh = setup.source.output_mesh
#python import testing import k3d document = k3d.new_document() setup = testing.setup_mesh_reader_test("K3DMeshReader","mesh.modifier.NurbsSkinnedSurfaceReference.k3d") modifier = setup.document.new_node("NurbsSkinnedSurface") modifier.along = 'y' modifier.delete_original = True modifier.mesh_selection = k3d.mesh_selection.select_all() document.set_dependency(modifier.get_property("input_mesh"), setup.reader.get_property("output_mesh")) testing.mesh_comparison_to_reference(document, modifier.get_property("output_mesh"), "mesh.modifier.NurbsSkinnedSurface", 1)
#python import k3d import testing setup = testing.setup_mesh_reader_test("PLYMeshReader", "mesh.modifier.PGPRemesh.torus.ply") modifier = setup.k3d.plugin.create("PGPRemesh", document) modifier.use_smooth = True modifier.steps = 15 modifier.h = 1000 modifier.omega = 10 modifier.div = 4 modifier.triangulate = True k3d.property.connect(document, setup.source.get_property(", modifier.get_property("input_mesh")output_mesh")) #print "source output: " + repr(source.output_mesh) #print "triangles output: " + repr(triangles.output_mesh) #print "modifier output: " + repr(modifier.output_mesh) testing.require_valid_mesh(setup.document, modifier.get_property("output_mesh")) testing.require_similar_mesh(setup.document, modifier.get_property("output_mesh"), "mesh.modifier.PGPRemesh.torus", 1)
#python import testing setup = testing.setup_mesh_reader_test("OBJMeshReader", "mesh.source.OBJMeshReader.polyhedron.obj") testing.mesh_comparison_to_reference(setup.document, setup.reader.get_property("output_mesh"), "mesh.source.OBJMeshReader.polyhedron", 1)
#python import testing import k3d document = k3d.new_document() setup = testing.setup_mesh_reader_test( "K3DMeshReader", "mesh.modifier.NurbsExtrudePatchReference.k3d") modifier = setup.document.new_node("NurbsPolygonizePatch") document.set_dependency(modifier.get_property("input_mesh"), setup.reader.get_property("output_mesh")) testing.mesh_comparison_to_reference(document, modifier.get_property("output_mesh"), "mesh.modifier.NurbsPolygonizePatch", 16)
#python import testing setup = testing.setup_mesh_reader_test("COLLADAMeshReader", "mesh.source.COLLADAMeshReader.duck.dae") testing.mesh_comparison_to_reference(setup.document, setup.reader.get_property("output_mesh"), "mesh.source.COLLADAMeshReader.duck", 1)
#python import testing setup = testing.setup_mesh_reader_test("GTSMeshReader", "mesh.source.GTSMeshReader.cube.gts.gz") 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.GTSMeshReader.gz.cube", 1)
#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)
#python import testing setup = testing.setup_mesh_reader_test("OBJMeshReader", "mesh.source.OBJMeshReader.nurbs.obj") testing.mesh_comparison_to_reference(setup.document, setup.reader.get_property("output_mesh"), "mesh.source.OBJMeshReader.nurbs", 1)
#python import testing setup = testing.setup_mesh_reader_test( "MD2MeshReader", "mesh.source.MD2MeshReader.dinosaur.md2") testing.mesh_comparison_to_reference(setup.document, setup.reader.get_property("output_mesh"), "mesh.source.MD2MeshReader.dinosaur", 1)
#python import testing setup = testing.setup_mesh_reader_test("OBJMeshReader", "mesh.source.OBJMeshReader.nurbs.obj") 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.OBJMeshReader.nurbs", 1)
#python import k3d import testing document = k3d.new_document() setup = testing.setup_mesh_reader_test("PLYMeshReader", "mesh.modifier.PGPRemesh.torus.ply") modifier = setup.document.new_node("PGPRemesh") modifier.use_smooth = True modifier.steps = 15 modifier.h = 1000 modifier.omega = 10 modifier.div = 4 modifier.triangulate = True document.set_dependency(modifier.get_property("input_mesh"), setup.reader.get_property("output_mesh")) #print "source output: " + repr(source.output_mesh) #print "triangles output: " + repr(triangles.output_mesh) #print "modifier output: " + repr(modifier.output_mesh) testing.mesh_comparison_to_reference(document, modifier.get_property("output_mesh"), "mesh.modifier.PGPRemesh.torus", 1)
#python import testing setup = testing.setup_mesh_reader_test("3DSMeshReader", "mesh.source.3DSMeshReader.test.3ds") testing.mesh_comparison_to_reference(setup.document, setup.reader.get_property("output_mesh"), "mesh.source.3DSMeshReader.test", 1)