Skip to content

CAD Modeling

65 Topics 227 Posts

Working with CAD models

  • CAD formats that can be imported in Sim4Life / SEMCAD X Matterhorn

    cad formats
    2
    0 Votes
    2 Posts
    2k Views
    brynB
    The list is actually quite a bit longer. For surface meshes is includes: VTK PLY OBJ OFF DAT (iSEG/ViP surface format) For image data it includes: PRJ (iSEG project files) NIFTY (NII, NII.GZ) DICOM MHA/MHD NRRD For unstructured meshes it includes: Exodus II VTU NASTRAN (partial support)
  • Importing polylines from text file

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    brynB
    You would have to define the polylines in a supported file format, e.g. VTK. To create such a file from Python, you could do something like this: import vtk # define points x1,y1,z1, etc. # add the actual points points = vtk.vtkPoints() points.InsertNextPoint(x1,y1,z1) points.InsertNextPoint(x2,y2,z2) points.InsertNextPoint(x3,y3,z3) # define the lines lines = vtk.vtkCellArray() lines.InsertNextCell(3) # next line is composed of 3 vertices lines.InsertCellPoint(0) # vertex 1 lines.InsertCellPoint(1) # vertex 2 lines.InsertCellPoint(2) # vertex 3 # assemble as surface mesh mesh = vtk.vtkPolyData() mesh.SetPoints(points) mesh.SetLines(lines) # write to file, supported by Sim4Life, Paraview, etc. writer = vtk.vtkDataSetWriter() writer.SetInputData(mesh) writer.SetFileName(r"E:\temp\Foo.vtk") writer.Write()
  • Introducing the Image Modeling module: Image and LabelField

    1
    2
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How can I export a mesh model as IGES

    4
    3 Votes
    4 Posts
    3k Views
    brynB
    @pcrespo By the way. Converting to Solid (using either method) only works well when a) the mesh resolution is not too high (else it will take forever and use huge amounts of memory) b) the surface mesh is manifold and has no self-intersections. these defects can be identified and often fixed using the Mesh Doctor ("Automatically Fix"). [image: 1525763911163-d38bb2c1-efd5-4038-b84a-605be284dda1-image.png] [image: 1525763920888-3d828313-84bb-4410-9be9-d584b6318823-image-resized.png]
  • Nearest point to a spline

    Solved python
    2
    0 Votes
    2 Posts
    1k Views
    S
    got it: wire = GetWires(spline)[0] curve = wire.GetGeometry(transform_to_model_space=True) law = curve.GetLaw() t0 = curve.MinDistParameter(point_start)