Creating a simple Circle with custom normal vector in vtk.js

Hello,

I’m currently working on a project that I’m porting from python into the browser using vtk.js.
The python version features circles with a given radius and a normal vector, created like this:

area = vtk.vtkRegularPolygonSource()
area.SetCenter(p_midpoint)
area.SetNormal(p_normal)
area.SetRadius(p_radius)
area.SetNumberOfSides(50)
area.Update()

I did not find any equivalent on the vtk.js side and tried to use a CircleSource, but I didn’t find a way of setting a normal vector.
I’m pretty new to vtk/vtk.js so there may be some obvious things I’ve overseen.
Whats the best way to visualize a circle like that?
Thanks!

The CircleSource can work but you will have to transform the points to orient them using your normal. You can take cue on the ConeSource for that part as an example for processing the generated polydata.

Use method setDirection and provide your normal vector