#voronoi #blender-addon #centerline #lindenmayer-3d

app toxicblend

gRPC based Blender-addons. WIP

12 releases

new 0.0.13 Aug 2, 2021
0.0.12 Jul 11, 2021
0.0.10 Jun 9, 2021
0.0.8 May 23, 2021
0.0.1 Feb 23, 2021

#9 in #voronoi

Download history 2/week @ 2021-04-10 48/week @ 2021-04-17 19/week @ 2021-04-24 23/week @ 2021-05-01 3/week @ 2021-05-08 21/week @ 2021-05-15 20/week @ 2021-05-22 2/week @ 2021-05-29 34/week @ 2021-06-05 4/week @ 2021-06-12 1/week @ 2021-06-19 2/week @ 2021-06-26 15/week @ 2021-07-03 12/week @ 2021-07-10 15/week @ 2021-07-17 14/week @ 2021-07-24

51 downloads per month

AGPL-3.0

325KB
7K SLoC

Rust 4.5K SLoC // 0.1% comments Python 2.5K SLoC // 0.1% comments

toxicblend.rs

crates.io Workflow Workflow dependency status

It is a client-server based addon for Blender written in Rust (and Python for the client side parts).

Blender addon installation

Follow instructions in install_as_blender_addon.md

Rust requirement

Will automatically make use of the fast(er) features hash_drain_filter and map_first_last if run on rust +nightly

Run local server

A blender addon based on a client-server model using grpc and tonic. The blender addon is the client, and it only connects to localhost. The server binds to localhost as well; so it should not be reachable from any other computer (not thoroughly tested), run it with this command:

cargo +nightly run --bin toxicblend_server --release

or just

cargo +nightly run --release

Run blender

If the grpc server (for any unimaginable reason) would crash, blender will hang waiting for response. This can easily be fixed if you run blender from the console. A ctrl - C will fix it.

Development status

Project is still in development, I will add more operations.

Addon operations:

These operations all operate in blender edit mode:

Operation: 2d outline

Will convert a flat mesh object into a 2D outline. Right now the data must be in a plane crossing origin (one axis need to be zero)

from

from

Operation: Simplify

Works similarly to the built-in simplify command, but instead of a distance it takes a percentage. This percentage is applied to the largest dimension of the AABB and that value is used as the Ramer–Douglas–Peucker distance. Works on 3D linestrings/polylines (no faces).

from

This percentage change makes it possible to simplify tiny objects without having to scale them up, simplify and then scale them down again.

Operation: Voronoi mesh

Runs the Voronoi sweep-line algorithm on loops of 2D lines and builds a 2½D mesh (input geometry must be on a plane crossing origin).

Important: You must encircle the input lines in one or more closed perimeters.

Even more important: Edges may only intersect at their end points, use the Knife intersect operation to make it so.

from

Operation: Centerline

Takes the output of the 2d_outline command and calculates the 3D centerline.

This operation only works on non-intersecting loops with islands of loops inside. E.g. fonts.

If you only need the 2D centerline, you can simply scale the added dimension to zero.

Keyboard command: s z 0 for setting Z to zero.

from

Operation: Voronoi

Runs the Voronoi sweep-line algorithm on 2D points and lines (geometry must be on a plane crossing origin).

from

Operation: Voxel

from

Takes an edge-only 3D mesh, like the output of the Voronoi operation, and puts voxelized tubes along the edges. This operation does not require flat input.

This operation uses building-blocks for voxel generation.

Operation: Metavolume (object operation)

Takes an edge-only mesh, like the output of the Voronoi operation, and puts metaballs along the edges. This operation does not require flat input.

This operation is located under Object -> Add -> Metaball -> MetaVolume

metavolume

Operation: LSystems (object operation)

Generates parametric Lindenmayer systems 3d graph/curves. This operation is located under Object -> Add -> Mesh -> LSystem

dragon_3d

dragon_curve

plant

arrowhead

hilbert

dragon_curve_3d

Operation: Gyroid (object operation)

Generates a parametric Gyroid

gyroid

Gyroid intersected with an egg-shape:

egg

Operation: Knife intersect

Runs on a single flat wire-frame object made of edges (no faces) and tests for self-intersections. If an intersection is found, the intersecting edges will be split at that point.

Operation: Select end vertices

Selects all wire-frame vertices that only connects to one other vertex. Useful for identifying dangling vertices.

Operation:Select vertices until intersection

Selects all (wire-frame) vertices that are connected to already selected vertices. It continues doing this until an intersection is detected. Could be useful for deleting strings of vertices generated by 'Knife intersect'

Operation: Select collinear edges

Select edges that are connected to the selected edges, but limit by an angle constraint. If edge A is selected and edge B is directly connected to it, B will be selected if the angle between A and B is smaller than the angle limit. B will then be used to select more edges and so on.

Operation: Select intersection vertices

Selects all vertices that connects to three or more other vertices. Useful for selecting intersections.

Operation: Debug object

Checks a mesh for anomalies, double edges etc. Will print results to the console/terminal.

Todo

  • Update to building-blocks 0.7.
  • Add command line options to the server, setting bind address and port. Possibly feature gated for security reasons.
  • Port the rest of the operations.
  • Lift the 'flatness' restriction, it should be enough with flat in any plane.

Dependencies

~12MB
~227K SLoC