Offset Node Issue

Next
 From:  James (JFH)
11298.1 
Hi Michael,

I have been experiencing an issue with offset node., which I have long believed to be a bug with the NE code.
However it has been brought to my attention that issue is not repeatable, at least by another user, MO.

If there are multiple closed curves, only one object will offset as expected. The others will only offset outwards
regardless of distance input (positive or negative values). This occurs in both "Long" & "Long+" modes.



We have the same setup, excepting he is on a PC & I'm on a Mac.

As a test, I performed a manual offset on the original 4 hexagons and found the offset worked similarly for each as expected;
however curiously "Trim" option does not appear to work.



I'm not sure if this is something you can shed light on.

James
https://www.instagram.com/nodeology/

EDITED: 18 Dec 2023 by JFH


  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11298.2 In reply to 11298.1 
Hi James, when you offset with "By distance" mode, there is still a point input that is taken for which side to offset to and if you have multiple shapes and you want to offset inside then since it's a single point it can only be inside one of them.

In the new beta you can use a negative distance and pick a point outside of them all as an alternative. The allowing negative input is new for this last beta release and I can repeat that it seems to interfere with the Trim option, I will investigate that. Before this last beta negative distance was not allowed with offset.

Thanks, - Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  James (JFH)
11298.3 In reply to 11298.2 
Thanks Michael,

Regarding issue with differing behaviours of Construct2/Offset on Mac & PC: in response to your message above, MO did a test to see point generated for the process. He discovered 18 points (twice the number of objects) were generated, half these were slightly off-centre in each object, while the others were a long way from target object (such to be outside the image captured).
(Image provide by MO, Thanks MO for all your assistance with this issue)

I repeated the test, and found also that the generated points were similarly 2x number of objects, however the internal points all fall dead at the origin (0,0), rather than within each object, as in MO's test.


(I attached magenta spheres for greater clarity)

This difference would appear to account for differing behaviour of offset node, though I can't be sure if it is operating system related or just unique to my particular setup.

James
https://www.instagram.com/nodeology/

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11298.4 In reply to 11298.3 
Hi James, can you please post the script code that does the computation of the point?

Thanks, - Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  James (JFH)
11298.5 In reply to 11298.4 
Thanks Michael,

The code for Offset node is attached: "offset.js"
I've also attached "main.js" because MO had suggested that the problem may in the difference
between 2 specific versions, for MacOS & for Windows.

I don't know enough about programming to direct you to particular lines in code.

Thanks for looking at this,
James
https://www.instagram.com/nodeology/
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
11298.6 In reply to 11298.5 
Hi James, I'm not seeing any different code paths in there for Mac vs Windows.

Is the difference in behavior due to a custom construction plane being set on one system versus default world cplane in the other?

Because the plane returned by the offset factory's .getCurvePlane() function is used in the regular offset command as a plane for the pointpicker. When a custom cplane is set the origin of that plane returned by .getCurvePlane() will be the cplane's origin. It probably isn't good to use the pointpicker plane's origin point as a basis for an inside/outside point for offset. It may look like a good candidate because in some cases it's sort of a centroid point but not when there is a custom cplane set.

Instead of trying to generate a point inside a closed curve automatically it's probably better to give a point outside of everything's bounding box and then set a negative offset distance although that may not work properly until the next release when I can get this offset trim problem fixed.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All