3
$\begingroup$

Good evening!

Sometime ago i asked a similar question but i did not get the right answer and the discussion went into a wrong direction. Maybe i did not express myself correctly.

That's why i did a new graphic to clearify my question: enter image description here

I am part of a project which wants to build a DIY rotational 3D-printer. One current problem is the slicing pipeline. Since we do not have a rotational slicer, we want to unfold a rotational 3D object, slice it with a traditional slicer and do some post-processing (like transforming to rotational coordinates).

That is why i am searching for a transformation function which "unfolds" a (maybe complex) cylindrical object along its rotational axis. Here the distances between two points on the surface (and also "inside" the volume) have to be the same in both objects. Otherwise the amount of extruded filament will to less. With every new layer this error increases and the printed object is not usable.

I found a related post here. But they don't keep the circular length of the layers and only unfold the cylinder with edges orthogonal to the resulting planes.

Does anybody know how I could achieve my transformation or knows how it is called? I have asked and searched a lot but did not find anything which worked the way i need it.

Or is there maybe a better place to ask my question?

Best regards!

$\endgroup$
3
  • 2
    $\begingroup$ Perhaps pedantic, perhaps not, but "Here the distances between two points on the surface (and also "inside" the volume) have to be the same in both objects." This is not literally possible. You can map one shape to the other. But distances will not be equal for all points in both shapes. $\endgroup$
    – Nathan
    May 22 at 23:20
  • $\begingroup$ So you're building a rotational 3D printer, but your pipeline is to use a slicer designed for a traditional printer, which takes care of physical considerations of flat printing, and convert it back to cylindrical (post-processing). I'd recommend to start from the end, make a flat mesh for a slicer, slice it, and try to create a post-processing pipeline that converts it to a cylinder for printing. I imagine doing it right will be harder than just studying how the slicer works and recreating one for cylinders. $\endgroup$ May 23 at 9:39
  • $\begingroup$ Thank you all for the comments, hints and solution tipps! Especially the nice illustrations and descriptions below from Nathan, André Zmuda and Markus von Broady. I think the best way will be to study how slicers work and build a rotational one. $\endgroup$
    – z3phyr
    Jun 3 at 20:38

2 Answers 2

4
$\begingroup$

Following, I will describe, how to do the conversion that is displayed in your sketch. As I am not experienced in 3d-printing, this does not take into consideration, if it is applicable to 3d-printing (see the answer of Nathan concerning a discussion about that).

We start by converting the points of the cylinder into the cylindrical coordinate system. As stated in Wikipedia,

For the conversion between cylindrical and Cartesian coordinates, it is convenient to assume that the reference plane of the former is the Cartesian xy-plane (with equation z = 0), and the cylindrical axis is the Cartesian z-axis.

Assuming further that x points to the right and y to the top of your sketch, we can compute the cylindrical coordinates as follows:

$$ r = \sqrt{x^2+y^2} $$

if $y \ge 0$ and $r \ne 0$: $$ \varphi = arccos\left( \frac{x}{r} \right) $$

if $y \lt 0$ and $r \ne 0$: $$ \varphi = -arccos\left( \frac{x}{r} \right) $$

To make it easier for me, I will assume, that the dotted line is on the right side of the cylinder and not on the bottom. Then - assuming radial angles - we can calculate the transformed object by:

$$ x’ = 2\pi r \cdot \frac{\varphi}{2 \pi} = r \cdot \varphi $$

For $y \ge 0$ and $r \ne 0$ we get: $$ x’ = \sqrt{x^2+y^2} \cdot arccos\left( \frac{x}{r} \right) $$

And for $y \lt 0$ and $r \ne 0$ we get: $$ x’ = - \sqrt{x^2+y^2} \cdot arccos\left( \frac{x}{r} \right) $$

$y'$ can be calculated by $$ y’ = r = \sqrt{x^2+y^2} $$

And $z'$ simply is: $$ z’ = z $$

Implementation in Geometry Nodes

Because joojaa asked for an implementation in geometry nodes, here it is:

result 1

result 2

node setup

To enable the transformation, we first have to cut the cylinder:

cutter

cutter 3d

Having done this, we can transform the cylinder:

transformation

The group node looks like this:

group node

$\endgroup$
3
  • $\begingroup$ This might be a better answer if you would how how to do thisin blenders nodes but its okay as is $\endgroup$
    – joojaa
    May 23 at 12:33
  • $\begingroup$ I changed the answer. Now, instead using the polar coordinate system, it reflects the usual way of applying the cylindrical coordinate system. $\endgroup$ May 23 at 20:47
  • $\begingroup$ @joojaa , I added the desired geometry nodes implementation $\endgroup$ May 23 at 21:18
3
$\begingroup$

I mentioned this in a comment, but I realized what I wrote could be interpreted a couple different ways, so I want to be more clear.

If somebody was doing this for rendering, André Zmuda's answer would be great. There are distortions involved, but they're distortions that we can undistort.

But you want to do this for 3D printing, and the distortions are probably not acceptable in your case. This goal for all distances to remain the same is impossible. It is the same problem as trying to UV map a sphere onto a flat plane, the same problem as trying to create a map of the world without any distortions.

Let's look at our cylinder and mark a few points of interest:

enter image description here

Now lets unwrap your cylinder as you've indicated, just a cross section, and see roughly where we want those points to map:

enter image description here

The bottom line is longer, because it corresponds to the outer circumference, like your picture except upside-down because I wasn't looking at it :) and the outer circumference is longer than the inner circumference, so our cross section is a long trapezoid.

On our cylinder, the shortest point between A and B was through the radius of the cylinder. But now these are angled, and B is actually closer to C than it was to A. By making this a trapezoid, we're turning what was a straight line between two circles-- the shortest path-- into what is now an angled line between two parallel straight lines. That angled line can never be the shortest distance.

Maybe you think there are some transformations that we could do to these points to get the distances back. Let's consider them.

First, we could scale A in toward the middle. But that's getting rid of the differences between our inner and outer circumferences-- that fixes the AB distance only at the point that our trapezoid becomes a rectangle. You've already indicated that this isn't what you want (and indeed, distances are not preserved in this shape either.)

What if we moved A toward B? Then we're no longer preserving the distance between A and C along the outer circumference.

Maybe we could move C further away, so that A became closer? Among other problems with this, this also no longer preserves the distance between A and C. (There are also an infinite number of points between A and C, and B being closer to any of those points isn't any better.)

What about B? Could we move it closer to A? When we move B closer to A, our inner circumference gets bigger to reach B. Again, we distort the inner/outer circumference, and AB doesn't become the shortest path until B gets all the way on top of A.

What if instead of using a trapezoid, we curved our circumferences? As we curve them, AB gets smaller as BC gets larger. How much curvature would we need to get this right? Exactly as much as it takes to make our original cylinder. We can curve the lines to fix the problem, but now it's no longer any mapping at all.

What's that mean for 3D printing? It means that any mapping of this sort will have to involve compression and/or stretching to roll your flat shape up into a cylinder. There is no way to preserve distances with this mapping.

Are there any mappings that can do this without distortion? There kind of is, but it's not much like your image, and it's also not possible in the real world. Just as in UV mapping we make tradeoffs between seams and distortion, we can make tradeoffs here. We can add more seams, at which point distortion decreases. But those seams need to cut through the volume. Your cross section would start by looking like this:

enter image description here

The inner and outer circumference reach the same bounds. The inner circumference is shorter only by virtue of the triangular cutouts.

That's not enough density of cuts to do a distortion free mapping, but it's a start. When you have a box with an infinite number of these cutouts, each infinitely thin, you have a distortion free mapping. That "infinity" is why it's not possible in reality. Again, this is a lot like UV mapping a sphere. We can get a distortion free unwrap, but only when we've seamed nearly every edge, and even then, only because it's not a real sphere, just a sampled sphere (and indeed, if we are working with a sampled cylinder, we could get away with a finite number of cutouts, depending on our sampling.)

But I don't think that mapping is very practical for 3D printing-- even sampled, our outer circumference has points (lines, in 3d) where it is infinitely thin-- and it's certainly not the mapping you had in mind.

$\endgroup$
11
  • 1
    $\begingroup$ @RobinBetts The length A-B is the thickness, i.e. the difference between the inner radius (the surface of the cylindrical equivalent of the printing table), and the outer radius (the "top" surface of the finished print). The length of the fuchsia line here: i.imgur.com/MEQ0nkQ.png - so of course AB matters. More importantly, AC matters, because various algorithms decide how the inside is filled, and if you squeeze/expand based on height/radius, you end up with too small/too big wall thickness or spacing between walls. $\endgroup$ May 23 at 9:46
  • 1
    $\begingroup$ Hi @MarkusvonBroady! what I'm trying to suggest, since this is slicing, ( without being sure of the steps in OP's pipeline) is that the mapped diagonal AB doesn't matter .. that what matters is the accuracy of h and c0 .. cn (as sampled) in this illustration. $\endgroup$ May 23 at 10:52
  • 1
    $\begingroup$ @RobinBetts What I'm worried will happen is that even with perfect accuracy, the slicer will just not produce a correct shape. You don't actually need to cut in the `/ \/ \/ \` pattern like in last image, because you're not printing it flat and then assembling in real world, you're only flattening it for a software and then restoring to cylindrical. But if you do that, then the slicer will create vertical supports, and they will no longer be "vertical" (well, orthogonal to printing surface). And if you just squeeze/expand, the wall thickness will get wrong: i.imgur.com/g4VRTO2 $\endgroup$ May 23 at 11:18
  • 1
    $\begingroup$ @MarkusvonBroady I bow to your superior knowledge of slicers. The devil is in the detail... and the off-by-ones. :) $\endgroup$ May 23 at 11:35
  • 1
    $\begingroup$ @RobinBetts I understand what you're saying now. I appreciate the nice words, but I'm wrong plenty, will be again, and I'm only educated as an f'in nurse, we only need to add and multiply and some of us can't even do that. Frankly, there are elements of this that seem paradoxical to me, and I've written an email to askamathematician.com . We do need infinite seams, regardless of orientation, to get distortion-free mapping, but those seamed shapes, I don't know for sure. If I get a reply, I'll let you know. $\endgroup$
    – Nathan
    May 23 at 23:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.