Skip to content

Commit 354a34b

Browse files
committed
Initial Release
0 parents  commit 354a34b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+8829
-0
lines changed

.gitignore

Lines changed: 497 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Compiling the PicoGK Runtime
2+
3+
We compiled and tested PicoGKRuntime on Windows 64 bit and MacOS 14 Sonoma. Since Mac is our primary work environnment, we have tested it on Mac significantly more than on Windows. There is, however, nothing fundamentally platform-specific about PicoGK. The main platform dependencies are well-established libraries like OpenVDB. Our code is very straightforward and mostly header-only C++ code.
4+
5+
## What you need
6+
7+
On Windows, you need **Visual Studio 2022 Community Edition** (or higher) with C++ support installed (bare bones C++ is enough).
8+
9+
On Mac, you need the latest version of **XCode** with C++ support, and the XCode command line tools.
10+
11+
In addition you need a current version of **CMake** (Download at https://cmake.org/)
12+
13+
## Installing dependent libraries
14+
15+
First clone the **PicoGKRuntime** repository to your machine.
16+
17+
Make sure to initialize the submodules (**git submodule update --init --recursive**), so that the OpenVDB submodule is properly initialized.
18+
19+
PicoGKRuntime has no dependencies besides **OpenVDB** and **GLFW** (which is fetched automatically), but those libraries have plenty of dependencies (boost, blosc, etc).
20+
21+
To facilitate the installation of these dependencies, we have provided you with two scripts that download and install everything needed.
22+
23+
On Mac, please run **PicoGKRuntime/Install_Dependencies/Mac.sh**
24+
25+
On Windows, please run **PicoGKRuntime/Install_Dependencies/Win.bat**
26+
Note: you may have to run Win.bat twice, due to a bug we haven't found yet. It works after the second time.
27+
28+
The installation of the dependencies may take a while, especially on Windows.
29+
30+
After you have done this, you can move onto compiling the PicoGK Runtime.
31+
32+
## Preparing the PicoGK Runtime Build Environment
33+
34+
Start the CMake GUI client and specify the path to the PicoGKRuntime repository in **"Where is the source code"**.
35+
36+
Specify the Build subfolder under **"Where to build the libraries"**. It should like this
37+
38+
<img src="images/image-20231017134154856.png" alt="image-20231017134154856" style="zoom:50%;" />
39+
40+
Hit **Configure** and accept all defaults. After Configure has run without errors, click **Generate**.
41+
42+
Note: On Mac, we advise to use "Unix Makefiles" as target. If you target XCode, you will get an error in the OpenVDB CMake setup. We have reached out to the OpenVDB team why this happens. You can safely comment out the offending lines in the OpenVDB CMake files, but this should not happen and it seems like an issue on their side.
43+
44+
Now you can compile PicoGKRuntime on your system.
45+
46+
## Compiling
47+
48+
On Mac, go to the **Build** subdirectory in **Terminal** and type **make** [enter] to run the make tool. The build process should start and you will get the compiled picogk.1.0.dylib in the Dist subfolder of PicoGKRuntime.
49+
50+
On Windows, open the resulting project in Visual Studio and compile (use the release version).
51+
52+
## Using the compiled Runtime
53+
54+
You either copy the resulting library to /usr/local/lib on Mac or the System32 folder on Windows (or any other folder that is in your system path).
55+
56+
A cleaner way, when you are still testing is to modify the path in the PicoGK C# library. You do this by opening PicoGK__Config.cs and pointing the path to your compiled library:
57+
58+
<img src="images/image-20231014185209784.png" alt="image-20231017164620416" style="zoom:50%;" />
59+
60+
One last thing — on Mac, you may have to sign the library using the **codesign** tool. Otherwise the library may not load.
61+
62+
## Code signing on the Mac
63+
64+
The necessary command line is **codesign -s LEAP71 picogk.1.0.dylib** — you need to have a valid code signing certificate for this (we used one we named LEAP71 — you can self issue this certificate, but it's a few steps).
65+
66+
Here is a relevant Apple article how to create self-signed certificates: https://support.apple.com/en-ae/guide/keychain-access/kyca8916/mac
67+
68+
[You may have to adjust your security settings as described here.](../Runtime/readme.md)

Documentation/README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# PicoGK Documentation
2+
3+
![PicoGKSketched](images/PicoGKSketched.jpg)
4+
5+
## Getting Started
6+
7+
**PicoGK is available and tested on MacOS X at this time. A Windows release will follow in the coming weeks.**
8+
9+
As a Computational Engineer, you write code to create sophisticated geometry. If you don't know how to code, there are many good tutorials available online.
10+
11+
PicoGK uses the C# language, a modern, fast, expressive and strongly-typed language that allow you to build complex algorithms using a simple syntax. If you are new to coding, don't despair! We have tried to make it as simple as possible to get started.
12+
13+
To install PicoGK, [follow this link](installation.md) for installation instructions.
14+
15+
Now let's dive in.
16+
17+
## Your first PicoGK App
18+
19+
For experts, here are the quick steps: In your **Program.cs** you call **PicoGK.Library.Go** with the voxel size and the task you want to execute. There are many example tasks in the **Examples** subfolder of the PicoGK repository.
20+
21+
**For detailed steps, read on.**
22+
23+
We assume you have followed the [Installation Guide](installation.md) and have created an empty Console application in Visual Studio.
24+
25+
Open your Visual Studio project. **Program.cs** should already be open.
26+
27+
It should look something like this
28+
29+
<img src="images/image-20231014161615187.png" alt="image-20231014161615187" style="zoom:50%;" />
30+
31+
Replace the text there with the following:
32+
33+
```c#
34+
PicoGK.Library.Go( 0.5f,
35+
PicoGKExamples.BooleanShowCase.Task);
36+
```
37+
38+
<img src="images/image-20231014184822502.png" alt="image-20231014184822502" style="zoom:50%;" />
39+
40+
And run it.
41+
42+
![image-20231014184919894](images/image-20231014184919894.png)If everything is right, a window will open, showing you a few spheres that are combined using Boolean operations. You can click and drag in the viewer to rotate, scroll to zoom, and use the cursor keys to rotate by 15º. The viewer is basic but functional.
43+
44+
If you are not seeing this window, you can check out the console window at the bottom of Visual Studio to see any error messages. These messages are also written to **PicoGK.log** in your Documents folder (you can change the location if you don't like that). One thing you may have to do on Mac is adjust the security settings, so PicoGK can load the pre-compiled PicoGKRuntime. [If you want to compile it yourself, here are the instructions](Compiling_PicoGKRuntime.md).
45+
46+
[Drop us a note in the discussion section of this repository](https://github.com/leap71/PicoGK/discussions), if you have any issues, and we will do our best to help. The most common problem is that the PicoGK Runtime library cannot be found. Double check if you copied it to the right system folder.
47+
48+
Congratulations, you can now code in PicoGK!
49+
50+
Check out the other examples from the Examples subdirectory of PicoGK. A fun way to work your way through is by simply typing a dot behind the PicoGKExamples namespace ID, as below, and you will see all the options. Just don't forget to add "Task" at the end.
51+
52+
If you dive into the code, you will see that it's super simple to create interesting things, even with the basic PicoGK functions.
53+
54+
<img src="images/image-20231014185209784.png" alt="image-20231014185209784" style="zoom:50%;" />
55+
56+
If you want to seriously dive in, [you should work using the LEAP 71 Shape Kernel.](https://github.com/leap71/ShapeKernel) and build your [Computational Engineering Models](https://leap71.com/computationalengineering/) on top.
57+
58+
If you'd like to dive into the details of compiling and developing the [PicoGKRuntime, you will find a setup guide here](Compiling_PicoGKRuntime.md).
459 KB
Loading
1.08 MB
Loading
60.2 KB
Loading
145 KB
Loading
160 KB
Loading
197 KB
Loading
91.5 KB
Loading

0 commit comments

Comments
 (0)