Voxelisation - 2nd Prototype

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Voxelisation - 1st Prototype

Post by paullee »

Further Developed Prototype tested and performance reported in - https://forum.freecadweb.org/viewtopic. ... 55#p532055
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Voxelisation - 2nd Prototype

Post by paullee »

Voxelisation in FreeCAD - Test 3 : 3 Voxel Modes

Current workflow for comment / suggestion: -

1. Select the shape object to 'voxelise', click Voxel button
2. Can select the shape of voxel, like (App::Link to) a Group w/ 4 Walls, Windows, Slab etc.
3. Has 3 modes :-
  1. Center : If Center of (the BoundBox of) voxel is within the Input Shape, it is shown
  2. Any Corner : If Any Corner of (the BoundBox of) voxel is within the Input Shape, it is shown
  3. All Corners : Only if All Corners of (the BoundBox of) voxel are within the Input Shape, it is shown
Proof of concept for fun. Calculation particularly for 'All Corners' mode become slow. Hope someone like to develop something more advanced in C++ for much better performance like what in Blender :D Test Feature added in SketchArchWB.

SketchArch WB / Python Updated
  1. SketchArch WB in https://github.com/paullee0/FreeCAD_SketchArch
  2. Or simply replace below 2 files
    ArchSketchObject.py
    (89.35 KiB) Downloaded 53 times
    InitGui.py
    (3.08 KiB) Downloaded 47 times
  3. Add below button image to ../icons directory
    Voxel.svg
    (30.14 KiB) Downloaded 52 times
Example file for testing
phpBB [video]
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Voxelisation - 2nd Prototype

Post by paullee »

3 Modes:
- 1. Center
- 2. Any Corner
- 3. All Corners
Screenshot from 2021-09-24 12-31-48.png
Screenshot from 2021-09-24 12-31-48.png (230.1 KiB) Viewed 1474 times
Screenshot from 2021-09-24 12-32-08.png
Screenshot from 2021-09-24 12-32-08.png (210.52 KiB) Viewed 1474 times
Screenshot from 2021-09-24 12-32-33.png
Screenshot from 2021-09-24 12-32-33.png (209.59 KiB) Viewed 1474 times
Screenshot from 2021-09-24 13-10-27.png
Screenshot from 2021-09-24 13-10-27.png (264.56 KiB) Viewed 1447 times
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Voxelisation - 2nd Prototype

Post by paullee »

Forgot to explain -
  1. Under the hood, pressing the button creates 2 objects
  2. First is a 'VoxelPart' object with a propertyLink to an 'Input Shape Object'
  3. Second is an App::Link which produce the Array of Voxels
    1. The VoxelPart calculates the placement of every Voxels
    2. It creates a Box, or copy the shape of 'VoxelObj' (usecase: point to a object with Shape, or to a Link to a Group containing a numbers of objects)
    3. The 2nd Object App::Link actually create the array of Voxels according to VoxelPart calculation
Post Reply