Gmsh is a mesh generator, but it permits to create geometry too. However there are some limitations for that. For example, you cannot create shapes that intersect each other. This feature rises from the way that Gmsh uses to define geometry. The process of geometry creation is sequential. At first you should define points, then lines, and so on. The full list of entities, that you should determine to create 3D model is here:
- points
- lines
- line loops
- surfaces
- surface loops
- volumes
To bind the model from these packages with Gmsh, you need to export geometry in one of OpenCascade formats (BRep, STEP or IGES, but note that IGES format is not recommended), or any other compatible to Gmsh format (STL, etc). Then you can load such model into Gmsh just typing in command line
$ gmsh model.brep
Note, that in some cases you'll need to turn off two options to see the model. They are "Remove small edges" and "Remove small faces" on Options -> Geometry -> General of GUI
Or write in geometry file (model.geo):
Merge "model.brep"; Geometry.OCCFixSmallEdges=0; // Remove small edges from GUI Geometry.OCCFixSmallFaces=0; // Remove small faces from GUI Mesh.CharacteristicLengthFactor = 0.5; // any actions with model
In this case Gmsh is launched:
$ gmsh model.geo
There is one additional feature: to load OpenCascade models, Gmsh should be built with OCCT support. And a little hint: if any of presented packages doesn't export a model in OCCT format, you can save it in some CAD format and then use CAD Exchanger for converting.