# CAD files in Julia

**URL:** <https://discourse.julialang.org/t/cad-files-in-julia/101898>\
**Category:** Modelling & Simulations\
**Created:** [July 21, 2023, 3:47pm UTC](https://discourse.julialang.org/t/cad-files-in-julia/101898 "2023-07-21T15:47:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![KapilKhanal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kapilkhanal/32/43976_2.png) [@KapilKhanal](https://discourse.julialang.org/u/KapilKhanal)\
**Post date:** [July 21, 2023, 3:47pm UTC](https://discourse.julialang.org/t/cad-files-in-julia/101898/1 "2023-07-21T15:47:43Z")

</div>

Is there a Julia package that imports CAD files or generates Spline-based mesh for higher-order elements in a numerical simulation? I see some barebones packages like BSplines.jl but they don’t have much of functionality to import or generate geometries and create elements on them.

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [July 21, 2023, 9:51pm UTC](https://discourse.julialang.org/t/cad-files-in-julia/101898/2 "2023-07-21T21:51:30Z")

</div>

You might be able to read dxf and dwg files with GMT.jl (`gmtread("somefile.dxf")`) but I never tried it.

---

<div class="post-metadata">

**Author:** ![martin.d.maas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martin.d.maas/32/50964_2.png) [@martin.d.maas](https://discourse.julialang.org/u/martin.d.maas)\
**Post date:** [July 22, 2023, 12:09am UTC](https://discourse.julialang.org/t/cad-files-in-julia/101898/3 "2023-07-22T00:09:24Z")

</div>

Do you mean STEP files? I haven’t seen any parser in pure Julia – those files are tough to parse, and then you need a full blown geometry kernel. The best one can do to open a STEP file, I guess, is PythonCall into [pyocc](https://github.com/tpaviot/pythonocc-core) (which binds the Open Cascade geometry kernel).

Then, if you want to define a geometry using NURBS patches, you could use [NURBS.jl](https://github.com/eOnofri04/NURBS.jl).

---

<div class="post-metadata">

**Author:** ![rmfritz](https://avatars.discourse-cdn.com/v4/letter/r/b487fb/32.png) [@rmfritz](https://discourse.julialang.org/u/rmfritz)\
**Post date:** [August 13, 2023, 8:36pm UTC](https://discourse.julialang.org/t/cad-files-in-julia/101898/4 "2023-08-13T20:36:50Z")

</div>

Unfortunately, most of the best CAD libraries are proprietary. What type of CAD data do you want to import? What program are you coming from?

You might try wrapping [Rhino’s openNURBS library](https://www.rhino3d.com/features/developer/opennurbs/), but I am only guessing at what you need.

---

<div class="post-metadata">

**Author:** ![garfield](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@garfield](https://discourse.julialang.org/u/garfield)\
**Post date:** [July 30, 2024, 10:50pm UTC](https://discourse.julialang.org/t/cad-files-in-julia/101898/5 "2024-07-30T22:50:25Z")

</div>

In case it is still of interest for you or others, the package [NURBS.jl](https://github.com/HoBeZwe/NURBS.jl) (registered and different from the NURBS package mentioned by @martin.d.maas) allows to read STEP files in pure Juila as detailed in the package [documentation](https://hobezwe.github.io/NURBS.jl/stable/fileio/#File-I/O).

---

<div class="post-metadata">

**Author:** ![martin.d.maas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/martin.d.maas/32/50964_2.png) [@martin.d.maas](https://discourse.julialang.org/u/martin.d.maas)\
**Post date:** [August 5, 2024, 6:31pm UTC](https://discourse.julialang.org/t/cad-files-in-julia/101898/6 "2024-08-05T18:31:18Z")

</div>

Oh, that’s very cool, thank you for providing the reference! I will definitively check it out

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [August 5, 2024, 6:50pm UTC](https://discourse.julialang.org/t/cad-files-in-julia/101898/7 "2024-08-05T18:50:57Z")

</div>

GeoIO.jl can load various mesh formats. Parametric curves are not supported yet, but can be in the future.
