All Projects → miho → Jcsg

miho / Jcsg

Licence: other
Java implementation of BSP based CSG (Constructive Solid Geometry)

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Jcsg

Musicott
JavaFX application that manages and plays music files.
Stars: ✭ 97 (-19.83%)
Mutual labels:  javafx
Gitpic
利用github做图床的小工具
Stars: ✭ 107 (-11.57%)
Mutual labels:  javafx
Binding.scala
Reactive data-binding for Scala
Stars: ✭ 1,539 (+1171.9%)
Mutual labels:  javafx
Lipi
A simple static blog generator.
Stars: ✭ 100 (-17.36%)
Mutual labels:  javafx
Coco
The fastest crypto online
Stars: ✭ 103 (-14.88%)
Mutual labels:  javafx
Pdfsam
PDFsam, a desktop application to extract pages, split, merge, mix and rotate PDF files
Stars: ✭ 1,829 (+1411.57%)
Mutual labels:  javafx
Measureit arch
An expansion of Antonio Vazquez's MeasureIt addon to add features to create Architectural Drawings in Blender 2.8
Stars: ✭ 93 (-23.14%)
Mutual labels:  cad
Flowless
Efficient VirtualFlow for JavaFX
Stars: ✭ 120 (-0.83%)
Mutual labels:  javafx
Asciidocfx
Asciidoc Editor and Toolchain written with JavaFX 16 (Build PDF, Epub, Mobi and HTML books, documents and slides)
Stars: ✭ 1,533 (+1166.94%)
Mutual labels:  javafx
Open Lowcode
Solution for rapid development of specific enterprise software
Stars: ✭ 116 (-4.13%)
Mutual labels:  javafx
Easyfxml
A collection of tools and libraries for easier development on the JavaFX platform!
Stars: ✭ 102 (-15.7%)
Mutual labels:  javafx
Snail
基于Java、JavaFX开发的下载工具,支持下载协议:BT(BitTorrent、磁力链接、种子文件)、HLS(M3U8)、FTP、HTTP。人家才不要你的⭐⭐呢,哼
Stars: ✭ 102 (-15.7%)
Mutual labels:  javafx
Leocad
A CAD application for creating virtual LEGO models
Stars: ✭ 1,782 (+1372.73%)
Mutual labels:  cad
Caption ocr tool
视频硬字幕提取工具
Stars: ✭ 98 (-19.01%)
Mutual labels:  javafx
Binjr
A Time Series Data Browser
Stars: ✭ 119 (-1.65%)
Mutual labels:  javafx
Cssfx
Allow runtime modification of JavaFX CSS
Stars: ✭ 95 (-21.49%)
Mutual labels:  javafx
Logfx
LogFX is a simple Log reader supporting color highlighting and able to handle giant files.
Stars: ✭ 109 (-9.92%)
Mutual labels:  javafx
Downlords Faf Client
Official client for Forged Alliance Forever
Stars: ✭ 121 (+0%)
Mutual labels:  javafx
Youtube Comment Suite
Download YouTube comments from numerous videos, playlists, and channels for archiving, general search, and showing activity.
Stars: ✭ 120 (-0.83%)
Mutual labels:  javafx
Jgnash
jGnash Personal Finance
Stars: ✭ 112 (-7.44%)
Mutual labels:  javafx

JCSG

Build Status Download Javadocs

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 (see CSG and Node classes). Thanks to the author for creating the csg.js library.

There's also the related VCSG library, a plugin for VRL-Studio and two extension libraries: JCSG-MeshExtension and JCSG-PathExtension.

In addition to CSG this library provides the following features:

  • optimized difference() and union() operations (many thanks to Sebastian Reiter)
  • extrusion of concave, non-intersecting polygons (uses Poly2Tri for triangulation)
  • convex hull (uses QuickHull3D)
  • weighted transformations (Scale, Rotation, Translation and Mirror)
  • STL import and export (STLLoader from Fiji)
  • OBJ export including material information (see screenshot below)
  • supports conversion of CSG's to JavaFX 3D nodes
  • 3d text support (using FXyz)

JCSG on stackoverflow.

To see what's possible with JCSG try JFXScad.

How to Build JCSG

Requirements

  • Java >= 11
  • Internet connection (dependencies are downloaded automatically)
  • IDE: Gradle Plugin (not necessary for command line usage)

IDE

Open the JCSG Gradle project in your favourite IDE (tested with NetBeans 7.4) and build it by calling the assemble task.

Command Line

Navigate to the Gradle project (e.g., path/to/JCSG) and enter the following command

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

bash gradlew assemble

Windows (CMD)

gradlew assemble

Code Sample:

// we use cube and sphere as base geometries
CSG cube = new Cube(2).toCSG();
CSG sphere = new Sphere(1.25).toCSG();

// perform union, difference and intersection
CSG cubePlusSphere = cube.union(sphere);
CSG cubeMinusSphere = cube.difference(sphere);
CSG cubeIntersectSphere = cube.intersect(sphere);
        
// translate geometries to prevent overlapping 
CSG union = cube.
        union(sphere.transformed(Transform.unity().translateX(3))).
        union(cubePlusSphere.transformed(Transform.unity().translateX(6))).
        union(cubeMinusSphere.transformed(Transform.unity().translateX(9))).
        union(cubeIntersectSphere.transformed(Transform.unity().translateX(12)));
        
// save union as stl
try {
    FileUtil.write(
            Paths.get("sample.stl"),
            union.toStlString()
    );
} catch (IOException ex) {
    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
}

Thanks to

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].