paperjs / paper.js

The Swiss Army Knife of Vector Graphics Scripting – Scriptographer ported to JavaScript and the browser, using HTML5 Canvas. Created by @lehni & @puckey

Home Page:http://paperjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Curve clone and constructor not behaving as expected

CutiePi opened this issue · comments

Description/Steps to reproduce

I noticed this issue when using a CurveLocation to split a path with splitAt(). If you create clones of the CurveLocation from the Curve, Time, Point you get something different because of the Curve. If you then use that CurveLocation to split the path it does not work.

I am not sure if it's an expected side-effect from the CurveLocations being from getIntersections of the path. But in general, I would expect a clone or a new object using the exact value to work the same...

Here I am creating new CurveLocation s but using the same Curve, Time and Point
image
If I use a clone of the Curve it does not work
image
If I create the new Curve myself from the values of the existing ones it also does not work
image

Link to reproduction test-case

Link to my sketch test

Expected result

A clone of a curve should an exact replica of the original, behaving and being used in the same way.

Additional information

Ubuntu 22.04 LTS
Node 18.14.2

Do you mean with or without index?
I think it is natural that there is no index since the cloned curve is not associated with a path.

Index is undefined on both the raw result of the intersections or the clones