Skip to content

Visualing surfaces/interfaces in 3D #134

Answered by mjhoptics
fu351 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @fu351,
Yes, I think you can do this in ray-optics without invoking ray-tracing.
The Surface class has an instance of a profile as an attribute. The sag() method on the profile can be used to give the z coordinate of a point x, y on the surface.

N = 5      # mesh dimension
mesh_list = []
for i in range(1, sm.get_num_surfaces()-1):
    mesh = []
    surf = sm.ifcs[i]
    sd = surf.surface_od()
    for xj in np.linspace(-sd, sd, num=N):
        mesh_row = []
        for yk in np.linspace(-sd, sd, num=N):
            if surf.point_inside(xj, yk):
                z = surf.profile.sag(xj, yk)
            else:
                z = None
            mesh_row.append(z)
        mesh.append(me…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fu351
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants