Skip to content

Commit

Permalink
Updates to documentation
Browse files Browse the repository at this point in the history
Removed the Mac security warning section, as our installers are now signed and notarized.
Added a description on how to quickly create a new PicoGK project using the command line.
Changed visual style of file/folder names and inline code to `code`
  • Loading branch information
LinKayser committed Jan 28, 2024
1 parent 6301db6 commit f09cf58
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 99 deletions.
16 changes: 0 additions & 16 deletions Documentation/Install_Mac.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@ Copy the PicoGK Example project from the disk image to your Documents folder (or

Double click **on Install PicoGK.pkg**

You will get a warning that the installer package cannot be verified (our installers are not code-signed — yet).

![](images/MacInstallerWarning.png)

Go to System Settings and under **Privacy and Security**

Make sure **App Store and identified developers** is enabled. Then click on **Open Anyway**.

<img src="images/MacSecuritySettings.png" style="zoom:50%;"/>

After entering your credentials, the following dialog pops up.

<img src="images/Mac_OpenInstaller.png" style="zoom:50%;" />

Choose **Open**

The PicoGK Installer will open.

<img src="images/MacInstaller1.png" style="zoom:50%;" />
Expand Down
52 changes: 0 additions & 52 deletions Documentation/MacSecurity.md

This file was deleted.

44 changes: 20 additions & 24 deletions Documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ Generally speaking, your PicoGK projects will look like this:

<img src="images/image-20231125165618361.png" style="zoom: 33%;" />

/**PicoGK Example** (your project folder)
`/PicoGK Example` (your project folder)

- **Program.cs** (your main execution code)
- `Program.cs` (your main execution code)
- ... other files (for example the Visual Studio project file)
- **/PicoGK** (contains the PicoGK submodule)
- **/ShapeKernel** (contains the LEAP71_ShapeKernel submodule)
- **/LatticeLibrary** (contains the LEAP71_Lattice submodule)
- `/PicoGK` (contains the PicoGK submodule)
- `/ShapeKernel` (contains the LEAP71_ShapeKernel submodule)
- `/LatticeLibrary` (contains the LEAP71_Lattice submodule)
- ... other submodules

**Program.cs** contains the code that executes your program. The PicoGK subfolder contains the source code of the PicoGK library. Under the hood PicoGK's C# code calls the PicoGK C++ runtime library for the heavy lifting. As many functions as possible are implemented directly in C# code, to make it simple to understand what is actually going on. Feel free to step into all functions using the debugger.
`Program.cs` contains the code that executes your program. The PicoGK subfolder contains the source code of the PicoGK library. Under the hood PicoGK's C# code calls the PicoGK C++ runtime library for the heavy lifting. As many functions as possible are implemented directly in C# code, to make it simple to understand what is actually going on. Feel free to step into all functions using the debugger.

If you have installed PicoGK using the installer, it you already have an example project in your **Documents** folder named **PicoGK Example**, which is ready to run.
If you have installed PicoGK using the installer, it you already have an example project in your `Documents` folder named `PicoGK Example`, which is ready to run.

## Running your first PicoGK App

Expand All @@ -46,7 +46,7 @@ Opening and running your first PicoGK app looks a bit different between VisualSt
- Running PicoGK Example on [VisualStudio](VisualStudio_FirstTime.md#Running-the-PicoGK-Example-Project)
- Running PicoGK Example on [VisualStudio Code](VisualStudioCode_FirstTime.md#Opening-and-running-the-PicoGK-test-project-in-Visual-Studio-Code)

Open **Program.cs** and you will see the following code.
Open `Program.cs` and you will see the following code.

```c#
try
Expand All @@ -61,7 +61,7 @@ catch (Exception e)
}
```

Inside the **try** block is the call to the PicoGK Library to run the task **PicoGKExamples.BooleanShowCase.Task** with a voxel size 0.5mm.
Inside the `try` block is the call to the PicoGK Library to run the task `PicoGKExamples.BooleanShowCase.Task` with a voxel size 0.5mm.

If something goes wrong in this task, an exception (an error) is thrown. The error will then be printed to the console output, so you can understand what went wrong.

Expand All @@ -75,22 +75,26 @@ The example showcases a few boolean operations.

You can browse to the [PicoGK/Examples/Ex_BooleanShowCase.cs](https://github.com/leap71/PicoGK/blob/main/Examples/Ex_BooleanShowCase.cs) file and check out the code.

On Mac, you will get a few **security warnings** that are a tedious, because our libraries are unsigned. [Here is how to solve this](MacSecurity.md).

What you have on screen is the **PicoGK Viewer**. You can click and drag in the viewer to rotate, scroll to zoom, and use the cursor keys to rotate by 15º. The viewer may seem basic but has many powerful functions, including the ability to show objects in multiple colors, animate the view, save screenshots and even create timelapse animations. If you like to test this out, check out the the [PicoGKExamples.TimeLapseAnimation.Task](https://github.com/leap71/PicoGK/blob/main/Examples/Ex_TimelapseAnimation.cs). We have animated entire gear trains and other moving objects in the viewer.

## Creating your own app

One of the easiest ways to get set up, is to simply copy the example to a new directory and rename the project file. Alternatively, If you know how to use Git/GitHub, here are the steps to create a new app:
One of the easiest ways to get set up, is to simply copy the example to a new directory and rename the project file.

Alternatively, If you know how to use Git/GitHub, here are the steps to create a new app:

- [Create a new **C# Console Project**](VisualStudio_CreateConsole.md) and add it to Git
- **Add PicoGK as submodule** using Git, and initialize it
- Add [LEAP71_ShapeKernel](https://github.com/leap71/LEAP71_ShapeKernel) and other [modules](https://github.com/leap71?tab=repositories) as needed.
- In your Program.cs, call **Library.Go()** with the appropriate parameters
- In your `Program.cs`, call `Library.Go()` with the appropriate parameters

> [!TIP]
>
> If you are comfortable with command line tools, here are [all the command line steps you need to take to create a new PicoGK project](Setup_PicoGK_Project_CommandLine.md).
## What's next?

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.
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.

<img src="images/image-20231125184538276.png" style="zoom:33%;" />

Expand All @@ -104,17 +108,9 @@ If you'd like to jump into the details of compiling and developing the [PicoGKRu

## Troubleshooting

### Cannot install on Mac, because of security warnings

At this time, both our installers and our libraries are not signed. So macOS will refuse to run the installer. [You can solve this by following these steps.](MacSecurity.md)

### First time I run on Mac, I get multiple security warnings

Same as above, this is because our runtime libraries and their dependencies are not signed (yet). [Here's how to fix this.](MacSecurity.md)

### PicoGK.log

PicoGK writes a detailed log of what is going on into **PicoGK.log**, which, by default, is located in your **Documents** folder. If you don't want us to spam your Documents folder, simply provide the path as the third parameter like this:
PicoGK writes a detailed log of what is going on into `PicoGK.log`, which, by default, is located in your `Documents` folder. If you don't want us to spam your `Documents` folder, simply provide the path as the third parameter like this:

```c#
PicoGK.Library.Go(0.5f, PicoGKExamples.BooleanShowCase.Task, "/Users/username/Documents/LogMeHere");
Expand All @@ -134,7 +130,7 @@ If you installed from the installers, this should not happen. If you compiled yo

<img src="images/image-20231125171044858.png" style="zoom: 33%;" />

If your viewer looks like this, then the PicoGK Viewer did not find the textures for the image-based lighting environment. The most likely case is that your folder structure is different from what we described in the first steps of this document. **PicoGK Viewer assumes that PicoGK is in a subfolder named PicoGK** directly in your main project directory. If this isn't the case, it cannot find the file **PicoGK/ViewerEnvironment/PicoGKDefaultEnv.zip** and the scene is unlit. The easiest way to solve this is to follow the folder structure we described. Alternatively, you can provide a path to the ViewerEnvironment in a parameter to Library.Go.
If your viewer looks like this, then the PicoGK Viewer did not find the textures for the image-based lighting environment. The most likely case is that your folder structure is different from what we described in the first steps of this document. **PicoGK Viewer assumes that PicoGK is in a subfolder named `PicoGK`** directly in your main project directory. If this isn't the case, it cannot find the file `PicoGK/ViewerEnvironment/PicoGKDefaultEnv.zip` and the scene is unlit. The easiest way to solve this is to follow the folder structure we described. Alternatively, you can provide a path to the ViewerEnvironment in a parameter to Library.Go.

### Where can I get help

Expand Down
71 changes: 71 additions & 0 deletions Documentation/Setup_PicoGK_Project_CommandLine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Using the Command Line tools to quickly set up a new PicoGK project

## Overview

The command line is the quickest way to set up a new project and clone the relevant GitHub submodules.

You have to have the .NET framework installed, as well as Github command line tools.

## Create a new C# console app

Open terminal and go to the location of you Github root (for example `/user/myuser/Github`).

Create a new .NET Console Project by using the following commands:

```
dotnet new console -n YourProjectName
```

## Add your project to Github

Create an empty README.md file in the root of your folder so that Github can track your project (Github doesn't track empty folders). Then add the newly created folder to Github

```
touch README.md
git init
git add .
```

> [!NOTE]
>
> Don't forget the dot after `git add`
## Add PicoGK and other submodules

Change into the newly-created directory (your project's root) and add PicoGK, ShapeKernel and other submodules you want.

```
git submodule add https://github.com/leap71/PicoGK PicoGK
git submodule add https://github.com/leap71/LEAP71_ShapeKernel ShapeKernel
git submodule add https://github.com/leap71/LEAP71_LatticeLibrary LatticeLibrary
```

Then initialize the submodules and update them.

```
git submodule init
git submodule update --init --recursive
```

## Summary

Here is it all in one block of script. Assuming you are at the root at your Github folder, such as Documents/Github.

```
dotnet new console -n YourProjectName
cd YourProjectName
touch README.md
git init
git add .
git submodule add https://github.com/leap71/PicoGK PicoGK
git submodule add https://github.com/leap71/LEAP71_ShapeKernel ShapeKernel
git submodule add https://github.com/leap71/LEAP71_LatticeLibrary LatticeLibrary
git submodule init
git submodule update --init --recursive
```

## .gitignore

The last step you should to before you start working is add a `.gitignore` file to your project, as otherwise you will track a lot of files that are temporary.

A good starting point is the one we use in PicoGK. You can either copy it from the PicoGK subfolder in your project, [or download it from here](https://github.com/leap71/PicoGK/blob/main/.gitignore).
8 changes: 4 additions & 4 deletions Documentation/VisualStudioCode_FirstTime.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Note** we show Mac screenshots. Windows is similar.

On Windows you [might want to consider using Visual Studio 2022](VisualStudio_FirstTime.md) and not Visual Studio Code. Visual Studio 2022 is the more comfortable development environment.
On Windows you [might want to consider using Visual Studio 2022](VisualStudio_FirstTime.md) and not Visual Studio Code. We think Visual Studio 2022 is the easier development environment.

## Install the .NET SDK from Microsoft

Expand Down Expand Up @@ -62,9 +62,9 @@ A security warning pops up (whose purpose only Microsoft understands, since we a

Unfold the folders on the left side. This is where project is organized.

Click on **Program.cs** — this is the main source file for your app.
Click on `Program.cs` — this is the main source file for your app.

In the default app, it just writes "Hello World" to the console output. With **Program.cs** selected, press the **Run and Debug** icon in the left toolbar.
In the default app, it just writes "Hello World" to the console output. With `Program.cs` selected, press the **Run and Debug** icon in the left toolbar.

<img src="images/VisualStudioCodeFirstProject.png" style="zoom:33%;" />

Expand Down Expand Up @@ -92,7 +92,7 @@ Choose **File->Open Folder**

<img src="images/VisualStudioCodeOpenFolder.png" style="zoom:50%;" />

Browse to the **PicoGK Example** project folder and open it.
Browse to the `PicoGK Example` project folder and open it.

You will receive the warning again, whether you want to trust the authors of this folder, it's **yes** again.

Expand Down
6 changes: 3 additions & 3 deletions Documentation/VisualStudio_FirstTime.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ After you launched VisualStudio, you the welcome screen is shown. **Choose Open

<img src="images/VisualStudio2022Welcome.png" style="zoom:50%;" />

Browse to where you installed the PicoGK demo project (default is **Documents/PicoGK Example**)
Browse to where you installed the PicoGK demo project (default is `Documents/PicoGK Example`)

Choose **PicoGK Example.vcproj**
Choose `PicoGK Example.vcproj`

<img src="images/VisualStudio2022OpenVCPRJ.png" style="zoom:50%;" />

The example project will open in Visual Studio. On the right side, you see your project files. **Program.cs** contains the main source code of the example.
The example project will open in Visual Studio. On the right side, you see your project files. `Program.cs` contains the main source code of the example.

Click on Program.cs to show the source code.

Expand Down

0 comments on commit f09cf58

Please sign in to comment.