Creating a plane with an origin in the middle

Hey,
I am trying to create a plane with an origin/center set in the middle (ie. 0.5x_length, 0.5y_length).
I don’t have a problem creating a plane, playing around with set center and origin yield weird results, the only predictable setup is having origin and center set to 0 then i get that origin/center to be at the edge of the plane. ive tried all kinds of combination of values but doesnt seem to work. any suggestions?

tangential_plane = vtk.vtkPlaneSource()
tangential_plane.SetCenter(0,0,0)
tangential_plane.SetOrigin(0,0,0)
tangential_plane.SetNormal(1,0,0)
tangential_plane.SetPoint1(20.0, 0.0, 0.0)
tangential_plane.SetPoint2(0.0,34.0, 0.0)
tangential_plane.SetXResolution(1)
tangential_plane.SetYResolution(1)
tangential_plane_node = slicer.modules.models.logic().AddModel(tangential_plane.GetOutputPort())
tangential_plane_node.SetName(“tangential_plane”)
tangential_plane_node.GetDisplayNode().SetColor(255,255,0)
#tangential_plane_node.GetDisplayNode().SetOpacity(1.0)
tangential_plane_node.GetDisplayNode().SetSliceIntersectionVisibility(True)
tangential_plane_node.GetDisplayNode().SetSliceIntersectionThickness(2)

transform = slicer.vtkMRMLTransformNode()
transform.SetName(“tangential_plane”+‘_trans’)
slicer.mrmlScene.AddNode(transform)
tangential_plane_node.SetAndObserveTransformNodeID(transform.GetID())

thanks

Yes, the VTK plane source has somewhat redundant parameterization and if you provide inconsistent input then the displayed plane is skewed.

I would recommended to use the markups plane node instead. It can be placed with more developer-friendly methods (and if you have any suggestions to improve its API then we can easily do that). Users can also move/rotate it interactively and it can be used as a cutting plane (in Dynamic modeler module) and will be used in more and more modules wherever an input or output plane is needed. It is available in recent Slicer Preview Releases.