Skip to content

pull in the rounding fix from @breiler #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 0 additions & 9 deletions .github/FUNDING.yml

This file was deleted.

67 changes: 0 additions & 67 deletions .github/workflows/release.yml

This file was deleted.

61 changes: 24 additions & 37 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,36 @@
name: "Test Build"

on: [pull_request]
on:
push:
tags:
- "v*.*.*"
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive

- name: List directory contents
run: pwd; ls -la

- name: start xvfb
run:
Xvfb :0 &
- name: Checkout repository and submodules
uses: actions/checkout@v3

- name: initialize the X11 DISPLAY variable
run:
export DISPLAY=:0
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: After checkout, list directory contnts
run: pwd; ls -la
- name: Install libraries
run: |
sudo apt update
sudo apt install libgtk2.0-0

- name: Pull a JavaFX JDK
run: wget http://static.azul.com/zulu/bin/zulu8.33.0.1-ca-fx-jdk8.0.192-linux_x64.tar.gz
- name: Start xvfb
run:
Xvfb :0 &

- name: After JDK download, list directory contnts
run: pwd; ls -la
- name: Initialize the X11 DISPLAY variable
run:
export DISPLAY=:0

- name: Set Java
uses: actions/setup-java@v1
with:
java-version: 1.8
jdkFile: ./zulu8.33.0.1-ca-fx-jdk8.0.192-linux_x64.tar.gz


- name: Test with Gradle
run: xvfb-run -s '-screen 0 1024x768x24' ./gradlew test


- name: Build and test
run: xvfb-run -s '-screen 0 1024x768x24' mvn clean install
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/build/
/target/
/bin/
.project
.classpath
Expand Down Expand Up @@ -34,3 +35,14 @@ html
/SVGExportTest5.svg
/box.svg.png
/brokenSTL.STL.png
/jcsg-svg/*.png
/jcsg-svg/*.svg
/jcsg/*.stl
.flattened-pom.xml
dependency-reduced-pom.xml
target/
build/
/jcsg-javafx/brokenSTL.STL.png
/jcsg-core/exampleText.stl
/jcsg-javafx/TextStl.stl
/jcsg-javafx/TextStl2.stl
1 change: 0 additions & 1 deletion .settings/.gitignore

This file was deleted.

22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

98 changes: 7 additions & 91 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
JCSG
=======

[![Join the chat at https://gitter.im/NeuronRobotics/JCSG](https://badges.gitter.im/NeuronRobotics/JCSG.svg)](https://gitter.im/NeuronRobotics/JCSG?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

# Documentation

[Javadoc Generated Documentation](https://neuronrobotics.github.io/JCSG/annotated.html)

Spike Examples [Part of BowlerStudio](http://commonwealthrobotics.com/JavaCAD/Overview/)

# Build Status

[![Build Status](https://travis-ci.org/NeuronRobotics/JCSG.png?branch=master)](https://travis-ci.org/NeuronRobotics/JCSG)

# Overview

Java implementation of BSP based CSG (Constructive Solid Geometry). It is the only simple and free Java implementation I am aware of. This implementation uses an optimized CSG algorithm based on [csg.js](https://github.com/evanw/csg.js) (see `CSG` and `Node` classes). Thanks to the author for creating the [csg.js](https://github.com/evanw/csg.js) library.

This package is based on Kevin Harringtons work from https://github.com/NeuronRobotics/JCSG and Michael Hoffer from https://github.com/miho/JCSG with the goal to remove the dependency to JavaFX.

In addition to CSG this library provides the following features:

- optimized `difference()` and `union()` operations (many thanks to Sebastian Reiter)
Expand All @@ -25,68 +13,23 @@ In addition to CSG this library provides the following features:
- weighted transformations (Scale, Rotation, Translation and Mirror)
- STL import and export (STLLoader from [Fiji](https://github.com/fiji/fiji/blob/master/src-plugins/3D_Viewer/src/main/java/customnode/STLLoader.java))
- OBJ export including material information (see screenshot below)
- supports conversion of CSG's to `JavaFX 3D` nodes
- 3d text support (using [FXyz](https://github.com/FXyz/FXyz))

**JCSG** on [stackoverflow](http://stackoverflow.com/search?q=jcsg).
- 3d text support

![](/resources/screenshot2.png)



## Maven
![](https://img.shields.io/nexus/r/https/oss.sonatype.org/com.neuronrobotics/JavaCad.svg?style=flat)
![](https://img.shields.io/nexus/r/https/oss.sonatype.org/com.breiler/jcsg.svg?style=flat)

```
<dependency>
<groupId>com.neuronrobotics</groupId>
<artifactId>JavaCad</artifactId>
<groupId>com.breiler</groupId>
<artifactId>jcsg-core</artifactId>
<version>VERSION_FROM_BADGE</version>
<type>zip</type>
</dependency>
```

## Gradle
![](https://img.shields.io/nexus/r/https/oss.sonatype.org/com.neuronrobotics/JavaCad.svg?style=flat)

```
repositories {
//com.neuronrobotics hosting point
maven { url 'https://oss.sonatype.org/content/repositories/staging/' }
}
dependencies {
compile "com.neuronrobotics:JavaCad:VERSION_FROM_BADGE"
}

```

## How to Build JCSG

### Requirements

- Java >= 1.8
- Internet connection (dependencies are downloaded automatically)
- IDE: [Gradle](http://www.gradle.org/) Plugin (not necessary for command line usage)

### IDE

Open the `JCSG` [Gradle](http://www.gradle.org/) project in your favourite IDE (tested with NetBeans 7.4) and build it
by calling the `assemble` task.

### Command Line

Navigate to the [Gradle](http://www.gradle.org/) project (e.g., `path/to/JCSG`) and enter the following command

#### Bash (Linux/OS X/Cygwin/other Unix-like shell)

sudo update-alternatives --config java # select Java 8
sudo apt-get install libopenjfx-java
bash gradlew assemble

#### Windows (CMD)

gradlew assemble

## Code Sample:


Expand Down Expand Up @@ -117,31 +60,4 @@ try {
} catch (IOException ex) {
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}
```


# CI Publish HOWTO set up

1. Export your gpg private key from the system that you have created it.
1. Find your key-id (using `gpg --list-secret-keys --keyid-format=long`)
2. Put the GPG id into a variable `OSSRH_GPG_SECRET_KEY_ID`
3. Export the gpg secret key to an ASCII file using `gpg --export-secret-keys -a <key-id> > secret.txt`
4. Edit `secret.txt` using a plain text editor, and replace all newlines with a literal "\n" until everything is on a single line
2. Set up [GitHub Actions secrets](https://github.com/organizations/CommonWealthRobotics/settings/secrets/actions)
1. Create a secret called `OSSRH_GPG_SECRET_KEY` using the text from your edited `secret.txt` file (the whole text should be in a single line)
2. Create a secret called `OSSRH_GPG_SECRET_KEY_PASSWORD` containing the password for your gpg secret key
3. Add Maven Credentials
1. In ~/gradle.properties, osshUsername `MAVEN_USERNAME`
2. In ~/gradle.properties, osshPassword `MAVEN_PASSWORD`

5. Create a GitHub Actions step to install the gpg secret key
1. Add an action similar to:
```yaml
- id: install-secret-key
name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
```
2. Verify that the secret key is shown in the GitHub Actions logs
3. You can remove the output from list secret keys if you are confident that this action will work, but it is better to leave it in there
```
38 changes: 0 additions & 38 deletions UpdateJavaDocs.sh

This file was deleted.

Loading