You probably want the shiny new version of Meshery:
https://github.com/OpenGolfSim/course-meshery-tool/releases
Important
This repo has been deprecated. Please use/refer to the new tool. This repo is only here for future reference.
Meshery is a tool that generates base course meshes from an SVG file and raw height map.
- Download and install the latest release for windows or mac from the releases page.
Meshery requires a few key files to create your meshes.
SVG files are usually automatically during the Course Terrain Tool steps of the course building process. However, you can also create SVGs from scratch for test or fantasy courses.
Your SVG file should contain a layer/group with an id of course. All course elements like fairway, bunker, green shapes should be placed within that group. All other groups/layers in the SVG will be ignored. This is useful for stashing guide layers or satellite or hillside images in other layers.
If you have issues with Meshery detecting your course shapes, verify the id of your course layer by selecting Edit > XML Editor... in Inkscape and verify you have a group element with the id set to course. (e.g. <g id="course">)
The vector shapes should be color coded to surfaces (fairway, bunker, etc.) using the official OGS color pallette.
-
Shapes need to be fully closed paths (no lines or objects). Make sure you convert any lines to closed path shapes.
-
Try and avoid sharp corners, or overlapping holes.
Simply save the SVG file in Inkscape (making sure it checks the above checklist). There's no need to remove or hide any layers.
Raw terrain height data is used to conform the generated meshes to the slope of your course terrain. Each time you make changes to the underlying terrain data (e.g. digging out bunkers or smoothing greens), you'll need to re-export that terrain data and re-run the meshery process.
- In the inspector, under your terrain's Settings tab, select Export Raw
- Depth: Bit 16
- Byte Order: Windows
- Flip Vertically: True
- Click Export
To generate your meshes:
- Open OGS Meshery
- Set the SVG file for your course
- Set the RAW terrain file for your course
- Set the Output Folder we should write the meshes to.
- Set the terrain height scale. (Usually found in your terrain stats CSV file)
- Click Generate Meshes to start the process.
- Once completed the generated OBJ files should be found in the output folder you selected.
The OGS SDK for Unity contains an import tool for automating the process of importing these meshes and batch assigning their materials. Follow the Unity SDK guide for importing and customizing meshes.
Warning
Note: Fow now, after importing the obj files into Unity, you likely need to manually reposition the imported mesh to line up with the terrain. It should be some variation of the terrain width height set on the x,z values in unity (try positive negative or halving the width/height). We're still working on this bug.
If you want to checkout and run this repository on your local machine:
Clone this repo:
git clone https://github.com/OpenGolfSim/meshery-tool.git
cd meshery-toolWe use pyenv to manage local builds.
pyenv virtualenv 3.13.9 mesh_venvSet the virtual env (do this each time you open a new shell window)
pyenv shell mesh_venvThen install the required dependencies:
pip install -r requirements.txtThen you can run with:
python src/meshery.pyWe use pyinstaller to create app bundles and exe files for windows and macos.
To build:
pyinstaller meshery.specHere's how I created the app icons. First add all the files you need to the iconset folder:
Meshery.iconset/icon_16x16@2x.png
Meshery.iconset/icon_32x32.png
Meshery.iconset/icon_32x32@2x.png
Meshery.iconset/icon_64x64.png
Meshery.iconset/icon_64x64@2x.png
Meshery.iconset/icon_128x128.png
Meshery.iconset/icon_128x128@2x.png
Meshery.iconset/icon_256x256.png
Meshery.iconset/icon_256x256@2x.png
Meshery.iconset/icon_512x512.png
Meshery.iconset/icon_512x512@2x.png
MacOS has a built-in utility called iconutil to create .icns files:
iconutil -c icns images/Meshery.iconset -o images/Meshery.icnsTo create the windows ICO file, you'll need to install the Imagemagick command-line tool. Take a 256x256 transparent PNG and use it as the input for this command:
magick images/Meshery.iconset/icon_256x256.png -define icon:auto-resize=16,24,32,48,64,256 images/meshery.ico