Esempio n. 1
0
    def test_model_surface(self):
        """Entry point for data mangling

        """
        c3d8_data = {'c3d8': {'data': self.cubic['c3d8'], 'fmt': binary_formats.c3d8()}}
        surf_res = dm.model_surface(self.nodes, c3d8_data)
        self.assertTrue(False)
Esempio n. 2
0
    def test__model_free_edges(self):
        """Get the free edges of the model

        """
        c3d8_data = {'c3d8': {'data': self.cubic['c3d8'], 'fmt': binary_formats.c3d8()}}
        res = dm._dataset_bulk_faces_and_edges(c3d8_data)
        bulk_edges = res['bulk_edges']
        res = dm._dataset_edges(bulk_edges)

        res_wf = res['wireframe_lines']
        res_fe = res['edge_lines']

        # sort edges
        ordered_wireframe = []
        for edge in res_wf:
            ordered_wireframe.append([min(edge), max(edge)])

        ordered_free_edges = []
        for edge in res_fe:
            ordered_free_edges.append([min(edge), max(edge)])

        for edge in ordered_free_edges:
            self.assertIn(edge, self.model_edges)

        for edge in ordered_wireframe:
            self.assertIn(edge, self.wf_edges)
Esempio n. 3
0
    def test__model_free_faces(self):
        """Get the free faces of the model

        """
        c3d8_data = {'c3d8': {'data': self.cubic['c3d8'], 'fmt': binary_formats.c3d8()}}
        res = dm._dataset_bulk_faces_and_edges(c3d8_data)
        bulk_faces = res['bulk_faces']
        res = dm._dataset_free_faces(bulk_faces)

        res_faces = res['free_faces']

        # permute result so that lowest index is first entry
        ordered_results = []
        for face in res_faces:
            min_val = min(face)
            faces = [[face[i - j] for i in range(len(face))] for j in range(len(face))]
            for cand in faces:
                if cand[0] == min_val:
                    ordered_results.append(cand)

        # permute result so that lowest index is first entry
        ordered_faces = []
        for face in self.free_faces:
            min_val = min(face)
            faces = [[face[i - j] for i in range(len(face))] for j in range(len(face))]
            for cand in faces:
                if cand[0] == min_val:
                    ordered_faces.append(cand)

        for face in ordered_results:
            self.assertIn(face, ordered_faces)
Esempio n. 4
0
    def test_model_surface_fields(self):
        """Get the field values

        """
        c3d8_data = {'c3d8': {'data': self.cubic['c3d8'], 'fmt': binary_formats.c3d8()}}
        surf_res = dm.model_surface(self.nodes, c3d8_data)
        node_map = surf_res['field_map']
        field_res = dm.model_surface_fields(node_map, self.field)
        self.assertTrue(False)
Esempio n. 5
0
    def test__surface_nodes_and_map(self):
        """Get a node map and a compressed set of nodes

        """
        c3d8_data = {'c3d8': {'data': self.cubic['c3d8'], 'fmt': binary_formats.c3d8()}}
        res = dm._dataset_bulk_faces_and_edges(c3d8_data)
        bulk_faces = res['bulk_faces']
        free_faces = dm._dataset_free_faces(bulk_faces)

        nodes = dm._surface_nodes_and_map(self.nodes, free_faces)
        self.assertTrue(False)