GithubHelp home page GithubHelp logo

Add offset from shape edges about voronoi HOT 4 OPEN

websvg avatar websvg commented on July 23, 2024
Add offset from shape edges

from voronoi.

Comments (4)

wassfila avatar wassfila commented on July 23, 2024 1

Thanks for the feedback, given this repo being my most successful so far, don't forget to star it by the way ;) , I think it's worth considering enhancements.

  • Single path limitation and top only can be improved

manually removing outside cells, I think that's performed with Display/in_cells instead of all

when it comes to complex shapes support, I suggest you give "Map" function a try and not "Shape". Given the non importance of input map being in pixels, you can use any image and not limited to svg. You can even use gradients, but for complex multi path and holes, just a black and white image should do, I'll try some examples, and if not already the case, I can forbid the sampler from touching some color limits so they act as absolute avoidance and not probabilistic.

  • minimum radius cells : I can think of that, but I'm afraid its contradicting the sampling logic. Adding it as postprocessing is easy, but if not ensured buy the sampler, it can break the harmony. So the number of cells defined by the user is somehow correlated to the cells size, forbidding a size lower than a limit and forcing a given number of cells is theoretically not possible, so fine adjustable constrains like path avoidance and cost map are more fit in this case. but well, I keep it, as I also have post filtering of min cell edge size for exa,ple, could be added there.

Also, the ui is reaching its complexity limit, and I learned more web tricks in the meanwhile, so that could be refactored to allow scaling in functions.

from voronoi.

wassfila avatar wassfila commented on July 23, 2024

Looks amazing what you've done. So it's not clear to me what could you achieve with the "Voronoi Editor webapp" and what you had to pre/post process outside the webapp.
The Webapp supports sampling alignment of seeds to avoid a certain path
see https://github.com/WebSVG/voronoi#the-nicer-way
a possible configuration is as follows
image
example with
https://github.com/WebSVG/voronoi/blob/master/data/giraffe.svg
image

Now in your post there's reference to two things :

  • tessellation shape with holes in it : Only a single path is supported and potentially playing on the that single path could add holes in it yet being a single path, the body shape might have a cut to let the single path through
  • second is the DXF, it is indeed a good idea if it accelerates the workflow. Now this proof of concept tool was only intended to do something not possible with other tools, but it is by far intending to replace usage of workflow with pre/post processing with other existing tools. Nowadays plugins can be available open source though and if it's reasonably easy, I can consider adding it.

So for the first point, if you have a reference SVG, you could share it by attaching it to this Issue, it does not have to be your productive shave, but any other shape shat can reproduce the intended function and I can have a look how it could work.

from voronoi.

yves-chevallier avatar yves-chevallier commented on July 23, 2024

IMHO The Voronoi webapp has three missing features:

  1. Support of complex shapes (with multiple SVG paths), for example a circle inside a circle.
  2. Allowing to "cut" cells at a specified "offset" from the path.
  3. Generate cells with a minimum radius (allowing milling with a tool with a known radius).

So in my example I generated the SVG from the web app, then apply the following changes in Illustrator/Inkscape:

  1. Add an offset of my shape on the top of the SVG
  2. Pathfinder/Divide to "cut" the shapes from this shape
  3. Manually remove all cells outside the shape
  4. Join all lines in a single shape

Then I was able to export the drawing in DXF and import it in Fusion 360.

From your remarks, converting SVG to DXF could be done with any online converter or good vector drawing software. This could be a nice to have feature, but not mandatory. Working with SVG is a smart and simple solution.

Alternatively for multiple shapes SVG, it could be nice to "display" other paths on the app for information only. The user could manually add cells at specific location to avoid the holes. But the algorithm doesn't need to take care of these shapes.

By the way, I had to manually edit the SVG exported from illustrator to bring the path at the top level.

from voronoi.

wassfila avatar wassfila commented on July 23, 2024

I tried with these Maps but could not get anything meaningful, I think the sampling condition is soft and so far it is still necessary to combine both Map and Shape to have the desired effects. If you have examples of reference "comlpex" SVG shapes I can try with you can post them here.
image

from voronoi.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.