3
$\begingroup$

Creating a 3D circular spiral phase plate using geometry nodes.

I'm trying to create different 3D phase plates about 5mm in diameter using geometry nodes that can be 3D printed out. They should look something like this.

img1

imgup

Image of my node network

img nodes

Attached Blender file.

Note: I can create one in Octave, but converting that to geometry nodes is a little different.

For background here's the Octave / Matlab code I used to generate the plot. To run the code online just go to https://octave-online.net/ and paste the code below in the box (you may need to change N=70 to N=20)

% Parameters
N = 70;  % Grid size
R = 1;    % Radius of the plate
m = 3;    % Topological charge (number of 2π phase cycles)

% Create grid
[x, y] = meshgrid(linspace(-R, R, N), linspace(-R, R, N));

% Convert to polar coordinates
r = sqrt(x.^2 + y.^2);
theta = atan2(y, x);

% Create phase plate
phase = mod(m * theta, 2*pi);

% Create height map (z-coordinate)
z = phase / (2*pi) * R;

% Mask the plate to be circular
mask = r <= R;
z = z .* mask;


% Plot the 3D spiral phase plate with black outlines
figure; 
surf(x, y, z, phase);%% Plot the 3D spiral phase plate

hold on;
contour3(x, y, z, [0 0], 'k', 'LineWidth', 2);
%
%shading flat; % Set shading to flat for a more "line-art" look
%colormap([1 1 1]); % Set colormap to white

axis equal;
xlabel('X');
ylabel('Y');
zlabel('Z');
title('3D Circular Spiral Phase Plate with Black Outlines');
%view(45, 30);

octave plot

$\endgroup$
5
  • $\begingroup$ I don't think your code formula outputs the image.... if Z is multiplied by R, the center of the object should be at Z = 0. $\endgroup$ Commented Nov 16 at 12:50
  • $\begingroup$ @DanielMöller I added a black and white image notice the S in the image is squareish and not a trianglesh" shape. $\endgroup$
    – Rick T
    Commented Nov 16 at 13:36
  • $\begingroup$ Yeah, your code is wrong. $\endgroup$ Commented Nov 16 at 13:56
  • $\begingroup$ @DanielMöller ok thanks here's a link that may help cnqo.phys.strath.ac.uk/research/quantum-theory-of-light/… $\endgroup$
    – Rick T
    Commented Nov 16 at 13:57
  • $\begingroup$ Answer updated. $\endgroup$ Commented Nov 16 at 14:05

1 Answer 1

2
+50
$\begingroup$

Solution 1 - Not following the code (code is wrong)

The code multiplies Z by R, which does not result in the graph plotted. This alternative does not multiply by R.

This image shows solution 1 and 2 together:

Solutions images

Main nodes

  • Here, we create a grid
  • Set Z
  • Extrude the outer rim back to Z = 0
  • Set the position of the center point to Max Z

Main nodes solution 1

Grid creation

  • Create a small circle
  • Select only the outer part of it (not the center point)
  • Repeatedly extrude it outwards
  • Return the outer rim selection for later use

Grid creation image

Z calculation (without multiplying R)

Used part of the code, without multiplying R in Z.
But I adjusted it to have a custom min and max heights.

Calculate Z image solution 1

Solution 2

I followed your code (I hope I didn't do anything wrong, but as I commented, it seems the graph doesn't relate to the math - To achieve the images, I guess we don't multiply the radius in the formula and create a special selection to set the position of the center point at the top - this selection would be "length of position near 0")

Main nodes

  • Here, we create a grid
  • Set Z
  • Extrude the outer rim back to Z = 0

(I created a circular grid instead of a square grid because it would be very jagged otherwise. The downside is that the very center of the object is made of triangles, but if you don't do subdivisions it won't be a problem)

Main nodes image

Grid Creation

Same as previous solution

Z calculation

Just the math from your code translated to nodes.
But I adjusted it to have a custom min and max heights

Height calculation image

File with both solutions

$\endgroup$
2
  • $\begingroup$ Thanks I added a black and white image notice the S in the image is squareish and not a trianglesh" shape. $\endgroup$
    – Rick T
    Commented Nov 16 at 13:38
  • 1
    $\begingroup$ Thanks for the help! $\endgroup$
    – Rick T
    Commented Nov 16 at 14:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .