Skip to content

PavelSavkin/fractal-primitives-unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fractal-primitives-unity

Teaser

Purpose

This project generates fractal tree and puts primitives on it. Inspired by Catlike Coding Unity C# Tutorials.

The aim is to generate 3d training data from scratch, to increase performance in 3D deep learning, such as point cloud registration or feature matching.

Although no significant performance improvement has been found by training such networks by ONLY using this dataset, mixing this data with other existing data such as ModelNet and ABC will help to gain performance.

Example neural network to use this: RPMNet, PointNetLK, DCP

Content

This repository contains two steps.

  1. Generating primitive based fractals into .fbx format (Unity)
  2. Applying boolean operation to generated .fbx ensure watertight (one membrane, no holes, no meshes inside meshes) 3d mesh, saving as .obj. (Blender)

1. Data generation

Tested with Windows 10 with Unity 2020.3.3f1.

This project saves .fbx file, and processes them into watertight meshes using blender (blender part to be added)

Usage

Generate one fractal primitive

  • clone the repository and open up using UnityHub
  • open up the GeneratroScene scene
  • start the scene, select FractalGenerator Object, and hit Create
  • hit again, and different fractal will pop up

Generate and save hundreds of fractal primitives

  • clone the repository and open up with Unity
  • open up the GeneratroScene scene
  • Inside FractalRecorder Object, edit FractalGenerateAndSave scripts' path to save and numver to save.

NOTE : If you run deeper fractal tree generation, time to save also needs to be tuned longer.

Customization

  • You can edit FractalObject.prefab in Assets/Resources to change generation behavior
    • You also can add / remove / change Meshes to use for generating fractal primitives
  • Note that if you make depth deeper, increase wait_time in FracatlGenerateAndSave, since it'll take while to generate complete fractal tree and put primitives in.

2. Boolean Operation

Tested with Blender 2.9.1.

Usage

  • install booltron into your Blender
  • Open Blender, delete all the detault objects
  • Go to Scripting tab, open python script
    • automatic_boolean_operation.py will simply apply union operation
    • automatic_boolean_operation_various.py will randomly apply union / difference / intersect operation
  • Set correct path
  • Execute it (Alt+P)

NOTE : You can try applying automatic_disp_noise.py afterwards, to add some noise to the models as well. You can try adding subdivision beforehand / try sulpting tool instead for further randomization.

BeforeAfter

Before (left) and After (right) the boolean union operation

License

MIT License

About

Generates a fractal tree and puts primitives to it with various shapes, orientations, and scales

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published