Add thickness to a line

Hi all,

I have a line separating two subdomains, I would like to know how to add a thickness to this line to turn it into a volume.

I know that in this case, I could simply add a third rectangle but the real case has plenty of lines like this of arbitrary shapes.

Cheers!

Remi

Hello Remi,

I don’t exactly what you mean by turning a line into a volume?
Do you want to have like a small cylinder?

You can extrude your line perpendicularly to it to create a rectangle face and the create a revolution with this face around your initial line.
If you prefer a rectangle, you can extrude the rectangle face in a perpendicular direction.

I think by volume I meant a surface yes, apologies.

Basically I would like to be able to, from an arbitrary Voronoi diagram like this, give thickness to the lines to treat them as a surface of their own.
I would assume that this line extrusion is the way to go then. How would it treat the tri-junctions?

a voronoi diagram is nothing more than a mesh, in your case a 2D mesh, you could go thought its connectivity and create each time the line and extrude it as fred mentioned.
could I ask the application/idea behind this? I find quite strange to go from mesh to CAD generally is the opposit, i am curious about.
can not remember if you can extrude edges in geom but if yes, it is quite simple to do in it and if not it takes a little bit of more steps but also faisable. (clearly using a script, not by gui)

Sorry for the confusion. I don’t want to have the voronoi diagram as the nodes of my mesh.

The application would be microstructure modelling where we have grains (and grain boundaries) that look like a voronoi diagram.

I would like to mesh all the grains (cells) as subdomains of a 2D mesh.
The specificity is that the grain boundaries (the edges) would need to be 2D not 1D cause I would like to give them different properties.

Something like this

from the image itself it is paraview,(or paravis or other flavors of it) and as it is from 21, it is for sure a mesh what they use.
for what you are trying to do you have 2 options:

  1. doing it in cad as you are suggesting, i personally think that it will be easier in geom as the scripting is way simpler to do.
  2. doing it in mesh directly, you can create the cells directly.
    i have way less knowledge in coding something like this in mesh but in geom it can be done for sure.

in any of the two options the first part is the same.
you go into the corresponding workbench, geom or shaper or mesh. create one face, the simplest you could, and then go to file/dump script (or dump python i can not remember right now) and open and modify that script to create everything.
this could be also coupled with a little bit of image recognition to go from image to resulting data automatically.

Yes, we need a mesh. I think going with geom is the way to go.

  1. Import nodes and edges from voronoi diagram
  2. extrude the edges to have the grain boundaries as surfaces too
  3. mesh everything with the mesh module

Does that sound reasonable?

yup. if I may:

  1. import nodes positions and conectivity
  2. create the corresponding edges
  3. create a plane that is as large in ounding box as your nodes
  4. use that plane use partition of the compound of all the edges
  5. go to mesh, select the resulting compound create mesh
    5b. select as 2D algorithm polygon by face (or something like that)
    5c. go to 1D wire discretisation, → number of elements per edge-> 1
    then compute
    you will get what you are looking for

also if i might give you another tip: import your photo in inkscape trace it MANUALLY! (this will take like 2 minuts) and then remove the image save it as svg which is a text file, and with some grep commands (linux) you could get so easily the nodes and connectivity

I don’t have a photo but a random voronoi diagram.
Where is the extrusion of the edges step?

This is basically what I’m after:

no need of extrusion. you can make a 2D mesh and extrude it if needed after

and this will turn the internal edges into surfaces? sorry but I’m a bit confused here

here you have a script doing what I said, I needed to go back and forth some times (erase some items so it might be a little bit dirty…)
example.py (3,5 KB)

regards,