Bug in Grasshopper Script

Hi,

I have made a script in one system and when I use the same script in other computer, curves seems to be flipped. Also order of curves and points changes for example if points are arranged 0,1,2,3 for 4 corner points of rectangle clockwise in one script its arranged anti clockwise in other script. So if I use list to extract point 3 it extracts point 1 in other computer.

May I know why this happens ? Kindly help @DavidRutten @PeterFotiadis

Hi,

Could it be the views are not equal.
If the geometry is flipped it could be one Rhino is looking at the bottom while the other is looking at the top.
Best would be to post the files here so others can have a look at it, the cause is hard to tell with no file at hand.

-Willem

that is tricky to post file because for you it might work and for others it will be different. Ok I will post a script let me know what you see. Kindly post top view.

Flipped_Curve_bug.gh (4.7 KB)

I see this:

Kindly check this and post the top view please.
Flipped_Curve_bug-01.gh (7.7 KB)

here you go

aha look at my top view. strange huh @Willem

try adding xy plane to bounding box and see it shows same like me please

Can you save the Rhino file you are working with, so I can compare it with mine.

Hi,

Kindly look at the baked curves in my rhino file.

Flipped_Curve_bug-01.3dm (23.2 KB)

so weird. This makes me crazy because fixing scripts many times if its uploaded in different system

I still get a different result.
can you run the SystemInfo command and paste the report here to see if we run the same Rhino verions

Rhino 6 SR21 2019-12-9 (Rhino 6, 6.21.19343.07571, Git hash:master @ 065e51d4aa4ae930b9c028f94e211dd62b201f8f)
License type: Commercial, build 2019-12-09
License details: Cloud Zoo.  In use by: Willem Derks ()

Windows 10.0 SR0.0 or greater (Physical RAM: 32Gb)
Machine name: WD10

Hybrid graphics system.
Primary display: Intel(R) HD Graphics 630 (Intel) Memory: 1GB, Driver date: 5-17-2017 (M-D-Y).
Primary OpenGL: NVIDIA GeForce GTX 1070 (NVidia) Memory: 8GB, Driver date: 3-17-2019 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 419.67

OpenGL Settings
  Safe mode: Off
  Use accelerated hardware modes: On
  Redraw scene when viewports are exposed: On
  
  Anti-alias mode: 4x
  Mip Map Filtering: Linear
  Anisotropic Filtering Mode: Height
  
  Vendor Name: NVIDIA Corporation
  Render version: 4.6
  Shading Language: 4.60 NVIDIA
  Driver Date: 3-17-2019
  Driver Version: 25.21.14.1967
  Maximum Texture size: 32768 x 32768
  Z-Buffer depth: 24 bits
  Maximum Viewport size: 32768 x 32768
  Total Video Memory: 8 GB

Rhino plugins
  C:\Program Files\Rhino 6\Plug-ins\Commands.rhp	"Commands"	6.21.19343.7571
  C:\Program Files\Rhino 6\Plug-ins\WebBrowser.rhp	"WebBrowser"	
  C:\Program Files\Rhino 6\Plug-ins\rdk.rhp	"Renderer Development Kit"	
  C:\Program Files\Rhino 6\Plug-ins\RhinoScript.rhp	"RhinoScript"	
  C:\Program Files\Rhino 6\Plug-ins\IdleProcessor.rhp	"IdleProcessor"	
  C:\Program Files\Rhino 6\Plug-ins\RhinoRender.rhp	"Rhino Render"	
  C:\Program Files\Rhino 6\Plug-ins\rdk_etoui.rhp	"RDK_EtoUI"	6.21.19343.7571
  C:\Program Files\Rhino 6\Plug-ins\rdk_ui.rhp	"Renderer Development Kit UI"	
  C:\Program Files\Rhino 6\Plug-ins\NamedSnapshots.rhp	"Snapshots"	
  C:\Program Files\Rhino 6\Plug-ins\Alerter.rhp	"Alerter"	
  C:\Program Files\Rhino 6\Plug-ins\IronPython\RhinoDLR_Python.rhp	"IronPython"	6.21.19343.7571
  C:\Program Files\Rhino 6\Plug-ins\RhinoCycles.rhp	"RhinoCycles"	6.21.19343.7571
  C:\Program Files\Rhino 6\Plug-ins\Grasshopper\GrasshopperPlugin.rhp	"Grasshopper"	6.21.19343.7571
  C:\Program Files\Rhino 6\Plug-ins\Toolbars\Toolbars.rhp	"Toolbars"	6.21.19343.7571
  C:\Program Files\Rhino 6\Plug-ins\3dxrhino.rhp	"3Dconnexion 3D Mouse"	
  C:\Program Files\Rhino 6\Plug-ins\Displacement.rhp	"Displacement"	
  C:\Users\Willem\AppData\Roaming\McNeel\Rhinoceros\packages\6.0\rhino-render-next\0.0.2\RhinoRenderNext.rhp	"Rhino Render Next"	0.0.2.0

Rhino 6 SR19 2019-10-22 (Rhino 6, 6.19.19295.01001, Git hash:master @ 0af62045bd35259d4c2367dbf7f9ef94ded29299)
License type: Evaluation, build 2019-10-22
License details: Stand-Alone
Expires on: 2020-02-14

Windows 10.0 SR0.0 or greater (Physical RAM: 16Gb)
Machine name: MURALI-CRAFT

Non-hybrid graphics.
Primary display and OpenGL: Intel® UHD Graphics 630 (Intel) Memory: 1GB, Driver date: 6-12-2019 (M-D-Y). OpenGL Ver: 4.6.0 - Build 26.20.100.6952

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On

Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: Height

Vendor Name: Intel
Render version: 4.6
Shading Language: 4.60 - Build 26.20.100.6952
Driver Date: 6-12-2019
Driver Version: 26.20.100.6952
Maximum Texture size: 16384 x 16384
Z-Buffer depth: 24 bits
Maximum Viewport size: 16384 x 16384
Total Video Memory: 1 GB

Rhino plugins
C:\Program Files\Geometry Gym\Rhino3d\ggRhinoIFC.rhp “ggRhinoIFC” 1.7.11.0
C:\Program Files\Rhino 6\Plug-ins\Commands.rhp “Commands” 6.19.19295.1001
C:\Program Files\Geometry Gym\Rhino3d\BullAnt.rhp “bullant” 1.4.4.0
C:\Program Files\Rhino 6\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 6\Plug-ins\RhinoRender.rhp “Rhino Render”
C:\Program Files\Rhino 6\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 6.19.19295.1001
C:\Program Files\Rhino 6\Plug-ins\rdk_ui.rhp “Renderer Development Kit UI”
C:\Program Files\Rhino 6\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 6\Plug-ins\IronPython\RhinoDLR_Python.rhp “IronPython” 6.19.19295.1001
C:\Program Files\Rhino 6\Plug-ins\RhinoCycles.rhp “RhinoCycles” 6.19.19295.1001
C:\Program Files\Rhino 6\Plug-ins\Grasshopper\GrasshopperPlugin.rhp “Grasshopper” 6.19.19295.1001
C:\Program Files\Rhino 6\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 6.19.19295.1001
C:\Program Files\Rhino 6\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Rhino 6\Plug-ins\Displacement.rhp “Displacement”

can you show the output of merge and reverse list component and point list numbers? so I can see which is flipped please.

Basically the value connecting to rectangle component. Plane, x size and y size

Try connecting boolean toggle to True and Connect to Join curves preserve and kindly post the top view.


This is with the join curves previewed

Does this help?

as you can see points/curves are flipped. Is there any method to solve these?

could it be that the trimmed surface that is baked became different from the original one?
can you post that trimmed surface in a file?

Flipped_Curve_bug-01-trimmed-surface.3dm (29.5 KB)

Kindly have a look at the file and please help me to fix it or provide solution so it wont be repeated in future for me.

I did some digging and realized that this is possibly caused by errors due to the boundingbox being flat.
The boundingbox has no height, so the edges have no length.
If the code has to join and sort curves with zero length I would not be surprized that differences in hardware would cause different results.

Try the gh file below and see of this gets similar results on both machines:
Flipped_Curve_bug-01_WD.gh (18.4 KB)

1 Like

Yes I get similar result like yours. So I use this alternate method instead of bounding box I did?