Partial tool automatically simplifies paths

I'm experimenting with guide shapes, which is a very nice feature! I would like to make a PCell that draws some geometry along a path, which can be edited by the user. It seems making a DPath as guide shape is the natural way to implement this, and I did some tests and it indeed works great.

However, I ran into one issue: the Partial tool automatically "simplifies" the path when it is edited; in particular if three or more neighboring points are on a line, it removes the middle points. This is sensible behavior for simple paths, indeed the path is the same after simplification, but for my guide path it poses a problem because my PCell will actually have some extra geometry at the points of the path, even if they are all on a line.

Here is a screen capture to show the example. As minimal example, I made a PCell that has only a DPath parameter and no actual geometry. At the start the path is initialized to 4 points, all on a line. When editing the shape with the Partial tool, one of the points disappears due to simplification.

So I have the following questions:

  • Is this the intended behavior of the Partial tool?
  • Is there a way to turn it off?

Thanks!

Here is the ruby code for the example PCell, which is based on the example in the PCell documentation:

module MyLib

  include RBA

  # Remove any definition of our classes (this helps when 
  # reexecuting this code after a change has been applied)
  MyLib.constants.member?(:PathTest) && remove_const(:PathTest)
  MyLib.constants.member?(:MyLib) && remove_const(:MyLib)

  # The PCell declaration for the circle
  class PathTest < PCellDeclarationHelper

    include RBA

    def initialize
      super

      # declare DPath parameter
      param(:s, TypeShape, "", :default => DPath::new([DPoint::new(0, 0), DPoint::new(100, 0), DPoint::new(200, 0), DPoint::new(300, 0)], 1))
    end

    def coerce_parameters_impl

    end

    def produce_impl    
      # Actual geometry implementaiton...      
    end
  end

  class MyLib < Library
    def initialize  
      self.description = "Test Library"
      layout.register_pcell("PathTest", PathTest::new)
      register("MyLib")

    end
  end

  MyLib::new
end

Comments

Sign In or Register to comment.