Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in sketch on face #1980

Closed
wants to merge 4 commits into from
Closed

Bug in sketch on face #1980

wants to merge 4 commits into from

Conversation

adamchalmers
Copy link
Collaborator

@adamchalmers adamchalmers commented Apr 1, 2024

This should add a second plumbus, but instead it fails because the tagged circle "arc-b" cannot be found.

The cause is that the API call to Solid3dGetExtrusionFaceInfo returns 3 ExtrusionFaceInfos when creating the first plumbus, but 0 for the second plumbus.

once fixed will close #1894

Copy link

vercel bot commented Apr 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview May 22, 2024 10:27pm

@Irev-Dev
Copy link
Collaborator

Irev-Dev commented Apr 1, 2024

I'll link this
https://github.com/KittyCAD/engine/issues/1898

Just because it's another situation where Solid3dGetExtrusionFaceInfo returns an empty array, feels related.

@adamchalmers
Copy link
Collaborator Author

I'm not sure this is an engine bug -- it could be, but, this was working before when the modeling-app was double-executing the first command of each pipeline. I don't know why fixing that would break this.

@Irev-Dev
Copy link
Collaborator

Irev-Dev commented Apr 4, 2024

In case it's useful here's a log of the plumbus calls

logs

[
  {
    "type": "send-scene",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "make_plane",
        "size": 100,
        "origin": {
          "x": 0,
          "y": 0,
          "z": 0
        },
        "x_axis": {
          "x": 1,
          "y": 0,
          "z": 0
        },
        "y_axis": {
          "x": 0,
          "y": 1,
          "z": 0
        },
        "clobber": false,
        "hide": true
      },
      "cmd_id": "d2a7f2f2-25a5-487a-89a9-665fba5a589d"
    }
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_batch_req",
      "batch_id": "ace3a401-5186-4e47-bd76-1ee0882206d6",
      "requests": [
        {
          "cmd": {
            "type": "set_scene_units",
            "unit": "mm"
          },
          "cmd_id": "a8a3eff2-f6e6-4f8d-9bbc-1f5549f22057"
        },
        {
          "cmd": {
            "type": "make_plane",
            "clobber": false,
            "hide": true,
            "origin": {
              "x": 0,
              "y": 0,
              "z": 0
            },
            "size": 60,
            "x_axis": {
              "x": 1,
              "y": 0,
              "z": 0
            },
            "y_axis": {
              "x": 0,
              "y": 1,
              "z": 0
            }
          },
          "cmd_id": "9a9fd88a-5a55-4b82-b712-6704f3966be7"
        },
        {
          "cmd": {
            "type": "sketch_mode_enable",
            "animated": false,
            "disable_camera_with_plane": {
              "x": 0,
              "y": 0,
              "z": 1
            },
            "ortho": false,
            "plane_id": "9a9fd88a-5a55-4b82-b712-6704f3966be7"
          },
          "cmd_id": "2a54febb-2b19-4c7f-b5e5-0377a6fbbcc6"
        },
        {
          "cmd": {
            "type": "start_path"
          },
          "cmd_id": "2a1b652a-0055-4f02-9228-d6f57af67708"
        },
        {
          "cmd": {
            "type": "move_path_pen",
            "path": "2a1b652a-0055-4f02-9228-d6f57af67708",
            "to": {
              "x": -24,
              "y": -24,
              "z": 0
            }
          },
          "cmd_id": "8801596d-e403-448d-bb62-99ca0ce85294"
        },
        {
          "cmd": {
            "type": "extend_path",
            "path": "2a1b652a-0055-4f02-9228-d6f57af67708",
            "segment": {
              "type": "line",
              "end": {
                "x": 48,
                "y": 0,
                "z": 0
              },
              "relative": true
            }
          },
          "cmd_id": "8ed4e058-2d37-4bfa-9b6f-83f6a9404f75"
        },
        {
          "cmd": {
            "type": "extend_path",
            "path": "2a1b652a-0055-4f02-9228-d6f57af67708",
            "segment": {
              "type": "line",
              "end": {
                "x": 14.832815729997478,
                "y": 45.65071278216737,
                "z": 0
              },
              "relative": true
            }
          },
          "cmd_id": "e02f57a5-7e9f-4fb9-9083-6603ff51efa3"
        },
        {
          "cmd": {
            "type": "extend_path",
            "path": "2a1b652a-0055-4f02-9228-d6f57af67708",
            "segment": {
              "type": "line",
              "end": {
                "x": -38.83281572999747,
                "y": 28.213692110038714,
                "z": 0
              },
              "relative": true
            }
          },
          "cmd_id": "93f7a91c-e8c5-4a7c-9717-df7fddff0caf"
        },
        {
          "cmd": {
            "type": "extend_path",
            "path": "2a1b652a-0055-4f02-9228-d6f57af67708",
            "segment": {
              "type": "line",
              "end": {
                "x": -38.83281572999748,
                "y": -28.213692110038707,
                "z": 0
              },
              "relative": true
            }
          },
          "cmd_id": "5bd707ef-f45a-41ed-894c-ec50f2b5fa0a"
        },
        {
          "cmd": {
            "type": "extend_path",
            "path": "2a1b652a-0055-4f02-9228-d6f57af67708",
            "segment": {
              "type": "line",
              "end": {
                "x": 14.832815729997478,
                "y": -45.65071278216737,
                "z": 0
              },
              "relative": true
            }
          },
          "cmd_id": "93c72490-f738-49f5-a5c4-ba6343cfc35f"
        }
      ]
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "1c1b5c54-926f-4f9c-a956-7bf190a1fe4c"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "d2a7f2f2-25a5-487a-89a9-665fba5a589d"
  },
  {
    "type": "send-scene",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "plane_set_color",
        "plane_id": "d2a7f2f2-25a5-487a-89a9-665fba5a589d",
        "color": {
          "r": 0.7,
          "g": 0.28,
          "b": 0.28,
          "a": 0.4
        }
      },
      "cmd_id": "3186d030-24c8-41d0-8d86-f62082b64d3e"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "a8a3eff2-f6e6-4f8d-9bbc-1f5549f22057",
    "cmd_type": "set_scene_units"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "9a9fd88a-5a55-4b82-b712-6704f3966be7",
    "cmd_type": "make_plane"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "2a54febb-2b19-4c7f-b5e5-0377a6fbbcc6",
    "cmd_type": "sketch_mode_enable"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "2a1b652a-0055-4f02-9228-d6f57af67708",
    "cmd_type": "start_path"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "8801596d-e403-448d-bb62-99ca0ce85294",
    "cmd_type": "move_path_pen"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "8ed4e058-2d37-4bfa-9b6f-83f6a9404f75",
    "cmd_type": "extend_path"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "e02f57a5-7e9f-4fb9-9083-6603ff51efa3",
    "cmd_type": "extend_path"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "93f7a91c-e8c5-4a7c-9717-df7fddff0caf",
    "cmd_type": "extend_path"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "5bd707ef-f45a-41ed-894c-ec50f2b5fa0a",
    "cmd_type": "extend_path"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "93c72490-f738-49f5-a5c4-ba6343cfc35f",
    "cmd_type": "extend_path"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "extrude",
        "cap": true,
        "distance": 30,
        "target": "2a1b652a-0055-4f02-9228-d6f57af67708"
      },
      "cmd_id": "403a0f5b-5e62-419d-a290-af8bf2d4fd32"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "3186d030-24c8-41d0-8d86-f62082b64d3e"
  },
  {
    "type": "send-scene",
    "data": {
      "type": "modeling_cmd_req",
      "cmd_id": "f157fd96-65d5-45c6-97c9-ac25b3055472",
      "cmd": {
        "type": "object_visible",
        "object_id": "d2a7f2f2-25a5-487a-89a9-665fba5a589d",
        "hidden": true
      }
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "403a0f5b-5e62-419d-a290-af8bf2d4fd32",
    "cmd_type": "extrude"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "object_bring_to_front",
        "object_id": "2a1b652a-0055-4f02-9228-d6f57af67708"
      },
      "cmd_id": "204a8fd0-611d-4482-af1c-f42763462a7f"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "f157fd96-65d5-45c6-97c9-ac25b3055472"
  },
  {
    "type": "send-scene",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "make_plane",
        "size": 100,
        "origin": {
          "x": 0,
          "y": 0,
          "z": 0
        },
        "x_axis": {
          "x": 0,
          "y": 1,
          "z": 0
        },
        "y_axis": {
          "x": 0,
          "y": 0,
          "z": 1
        },
        "clobber": false,
        "hide": true
      },
      "cmd_id": "5bbec679-256f-4172-8c99-aa8a11800f8e"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "204a8fd0-611d-4482-af1c-f42763462a7f",
    "cmd_type": "object_bring_to_front"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "solid3d_get_extrusion_face_info",
        "edge_id": "8ed4e058-2d37-4bfa-9b6f-83f6a9404f75",
        "object_id": "2a1b652a-0055-4f02-9228-d6f57af67708"
      },
      "cmd_id": "403a0f5b-5e62-419d-a290-af8bf2d4fd32"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "5bbec679-256f-4172-8c99-aa8a11800f8e"
  },
  {
    "type": "send-scene",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "plane_set_color",
        "plane_id": "5bbec679-256f-4172-8c99-aa8a11800f8e",
        "color": {
          "r": 0.28,
          "g": 0.7,
          "b": 0.28,
          "a": 0.4
        }
      },
      "cmd_id": "205a8107-7087-489f-aee4-1b0cb3142b3f"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "solid3d_get_extrusion_face_info",
          "data": {
            "faces": [
              {
                "curve_id": "8ed4e058-2d37-4bfa-9b6f-83f6a9404f75",
                "face_id": "97cfc06f-67b0-48f1-8936-0cf7daa92c16",
                "cap": "none"
              },
              {
                "curve_id": "e02f57a5-7e9f-4fb9-9083-6603ff51efa3",
                "face_id": "b3d4ce58-ebf2-42b4-bea5-252f12a1586a",
                "cap": "none"
              },
              {
                "curve_id": "93f7a91c-e8c5-4a7c-9717-df7fddff0caf",
                "face_id": "85bcea3b-5da4-44f5-95d1-4f9a81a6191f",
                "cap": "none"
              },
              {
                "curve_id": "5bd707ef-f45a-41ed-894c-ec50f2b5fa0a",
                "face_id": "12290430-cc9c-45b7-ab4a-4a488f86852d",
                "cap": "none"
              },
              {
                "curve_id": "93c72490-f738-49f5-a5c4-ba6343cfc35f",
                "face_id": "400b7502-f2ce-4730-af4f-8deae7d6b49f",
                "cap": "none"
              },
              {
                "curve_id": null,
                "face_id": "188ca872-41d8-4b1c-8b59-36c9f3e74462",
                "cap": "bottom"
              },
              {
                "curve_id": null,
                "face_id": "0865c672-883c-40de-8406-c0e411f5af1f",
                "cap": "top"
              }
            ]
          }
        }
      }
    },
    "id": "403a0f5b-5e62-419d-a290-af8bf2d4fd32",
    "cmd_type": "solid3d_get_extrusion_face_info"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_batch_req",
      "batch_id": "29621747-94e2-493c-8a22-36994b297e67",
      "requests": [
        {
          "cmd": {
            "type": "enable_sketch_mode",
            "adjust_camera": false,
            "animated": false,
            "entity_id": "97cfc06f-67b0-48f1-8936-0cf7daa92c16",
            "ortho": false
          },
          "cmd_id": "6a296303-167f-4607-8f45-f629e21b9833"
        },
        {
          "cmd": {
            "type": "start_path"
          },
          "cmd_id": "a0430597-c0fc-4669-ac78-1f077da6a6c7"
        },
        {
          "cmd": {
            "type": "move_path_pen",
            "path": "a0430597-c0fc-4669-ac78-1f077da6a6c7",
            "to": {
              "x": 9,
              "y": 0,
              "z": 0
            }
          },
          "cmd_id": "0e3a9a3d-646a-4d3c-a289-08fec593cba7"
        },
        {
          "cmd": {
            "type": "extend_path",
            "path": "a0430597-c0fc-4669-ac78-1f077da6a6c7",
            "segment": {
              "type": "arc",
              "center": {
                "x": 0,
                "y": 0
              },
              "end": {
                "unit": "degrees",
                "value": 360
              },
              "radius": 9,
              "relative": false,
              "start": {
                "unit": "degrees",
                "value": 0
              }
            }
          },
          "cmd_id": "bd481e16-2f90-48dd-b6d6-c3132869e05d"
        },
        {
          "cmd": {
            "type": "close_path",
            "path_id": "a0430597-c0fc-4669-ac78-1f077da6a6c7"
          },
          "cmd_id": "fc7a2f14-ef42-4c58-90bc-364bc391accb"
        }
      ]
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "205a8107-7087-489f-aee4-1b0cb3142b3f"
  },
  {
    "type": "send-scene",
    "data": {
      "type": "modeling_cmd_req",
      "cmd_id": "d569904a-1efa-4648-ae89-654bf9ff1504",
      "cmd": {
        "type": "object_visible",
        "object_id": "5bbec679-256f-4172-8c99-aa8a11800f8e",
        "hidden": true
      }
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "6a296303-167f-4607-8f45-f629e21b9833",
    "cmd_type": "enable_sketch_mode"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "a0430597-c0fc-4669-ac78-1f077da6a6c7",
    "cmd_type": "start_path"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "0e3a9a3d-646a-4d3c-a289-08fec593cba7",
    "cmd_type": "move_path_pen"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "bd481e16-2f90-48dd-b6d6-c3132869e05d",
    "cmd_type": "extend_path"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "fc7a2f14-ef42-4c58-90bc-364bc391accb",
    "cmd_type": "close_path"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "extrude",
        "cap": true,
        "distance": 18,
        "target": "a0430597-c0fc-4669-ac78-1f077da6a6c7"
      },
      "cmd_id": "3fd354ea-7160-4345-821d-2cbf6ca778e2"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "d569904a-1efa-4648-ae89-654bf9ff1504"
  },
  {
    "type": "send-scene",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "make_plane",
        "size": 100,
        "origin": {
          "x": 0,
          "y": 0,
          "z": 0
        },
        "x_axis": {
          "x": 1,
          "y": 0,
          "z": 0
        },
        "y_axis": {
          "x": 0,
          "y": 0,
          "z": 1
        },
        "clobber": false,
        "hide": true
      },
      "cmd_id": "f55b4e72-4bac-4909-9cf3-c8ebbef976e5"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "3fd354ea-7160-4345-821d-2cbf6ca778e2",
    "cmd_type": "extrude"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "sketch_mode_disable"
      },
      "cmd_id": "cdf39649-7f90-4a30-b68a-bf0079941954"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "f55b4e72-4bac-4909-9cf3-c8ebbef976e5"
  },
  {
    "type": "send-scene",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "plane_set_color",
        "plane_id": "f55b4e72-4bac-4909-9cf3-c8ebbef976e5",
        "color": {
          "r": 0.28,
          "g": 0.28,
          "b": 0.7,
          "a": 0.4
        }
      },
      "cmd_id": "4b1d5228-5c08-4ee4-abb6-52506f2bd7c7"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "cdf39649-7f90-4a30-b68a-bf0079941954",
    "cmd_type": "sketch_mode_disable"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "object_bring_to_front",
        "object_id": "a0430597-c0fc-4669-ac78-1f077da6a6c7"
      },
      "cmd_id": "8605d17b-25c4-4949-abee-ca1e4864d7d6"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "4b1d5228-5c08-4ee4-abb6-52506f2bd7c7"
  },
  {
    "type": "send-scene",
    "data": {
      "type": "modeling_cmd_req",
      "cmd_id": "e1266fe4-b257-4eed-ae73-bc8a7724dda0",
      "cmd": {
        "type": "object_visible",
        "object_id": "f55b4e72-4bac-4909-9cf3-c8ebbef976e5",
        "hidden": true
      }
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "8605d17b-25c4-4949-abee-ca1e4864d7d6",
    "cmd_type": "object_bring_to_front"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "solid3d_get_extrusion_face_info",
        "edge_id": "bd481e16-2f90-48dd-b6d6-c3132869e05d",
        "object_id": "2a1b652a-0055-4f02-9228-d6f57af67708"
      },
      "cmd_id": "3fd354ea-7160-4345-821d-2cbf6ca778e2"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "e1266fe4-b257-4eed-ae73-bc8a7724dda0"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "solid3d_get_extrusion_face_info",
          "data": {
            "faces": [
              {
                "curve_id": "bd481e16-2f90-48dd-b6d6-c3132869e05d",
                "face_id": "5e55b91f-2dd0-4721-853c-6266f25b7841",
                "cap": "none"
              },
              {
                "curve_id": null,
                "face_id": "cf919eee-cf32-40d0-8ea0-3a2f7525299b",
                "cap": "bottom"
              },
              {
                "curve_id": null,
                "face_id": "ac238a2d-65b5-4e71-af24-123a2cb89aaa",
                "cap": "top"
              }
            ]
          }
        }
      }
    },
    "id": "3fd354ea-7160-4345-821d-2cbf6ca778e2",
    "cmd_type": "solid3d_get_extrusion_face_info"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "solid3d_get_opposite_edge",
        "edge_id": "bd481e16-2f90-48dd-b6d6-c3132869e05d",
        "face_id": "5e55b91f-2dd0-4721-853c-6266f25b7841",
        "object_id": "2a1b652a-0055-4f02-9228-d6f57af67708"
      },
      "cmd_id": "cb8e522d-ccf9-4116-b76d-43f42f165d09"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "solid3d_get_opposite_edge",
          "data": {
            "edge": "3d3da7f3-a400-4186-90e3-a97ccaf14530"
          }
        }
      }
    },
    "id": "cb8e522d-ccf9-4116-b76d-43f42f165d09",
    "cmd_type": "solid3d_get_opposite_edge"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_batch_req",
      "batch_id": "ded913a3-44bf-420d-9803-7a6e58bf063a",
      "requests": [
        {
          "cmd": {
            "type": "solid3d_fillet_edge",
            "edge_id": "bd481e16-2f90-48dd-b6d6-c3132869e05d",
            "object_id": "2a1b652a-0055-4f02-9228-d6f57af67708",
            "radius": 0.4,
            "tolerance": 1e-7
          },
          "cmd_id": "8b99e155-9ace-4074-8864-71652786bf84"
        },
        {
          "cmd": {
            "type": "solid3d_fillet_edge",
            "edge_id": "3d3da7f3-a400-4186-90e3-a97ccaf14530",
            "object_id": "2a1b652a-0055-4f02-9228-d6f57af67708",
            "radius": 0.4,
            "tolerance": 1e-7
          },
          "cmd_id": "18cf2756-0872-46bb-a58f-b06dc1be6bf2"
        },
        {
          "cmd": {
            "type": "enable_sketch_mode",
            "adjust_camera": false,
            "animated": false,
            "entity_id": "b3d4ce58-ebf2-42b4-bea5-252f12a1586a",
            "ortho": false
          },
          "cmd_id": "4c2e42fe-dc6c-44ae-b561-b1aeecb52099"
        },
        {
          "cmd": {
            "type": "start_path"
          },
          "cmd_id": "6ea78590-5882-454a-bed4-b7fa72c4ed6a"
        },
        {
          "cmd": {
            "type": "move_path_pen",
            "path": "6ea78590-5882-454a-bed4-b7fa72c4ed6a",
            "to": {
              "x": 9,
              "y": 0,
              "z": 0
            }
          },
          "cmd_id": "4adc8f34-426d-49d7-8815-70bf88b0a726"
        },
        {
          "cmd": {
            "type": "extend_path",
            "path": "6ea78590-5882-454a-bed4-b7fa72c4ed6a",
            "segment": {
              "type": "arc",
              "center": {
                "x": 0,
                "y": 0
              },
              "end": {
                "unit": "degrees",
                "value": 360
              },
              "radius": 9,
              "relative": false,
              "start": {
                "unit": "degrees",
                "value": 0
              }
            }
          },
          "cmd_id": "0f72afaa-2aa4-4dd4-bf8f-43dc3d21fa8c"
        },
        {
          "cmd": {
            "type": "close_path",
            "path_id": "6ea78590-5882-454a-bed4-b7fa72c4ed6a"
          },
          "cmd_id": "cc919440-bc02-481d-b7ab-b5484e6fd373"
        }
      ]
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "8b99e155-9ace-4074-8864-71652786bf84",
    "cmd_type": "solid3d_fillet_edge"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "18cf2756-0872-46bb-a58f-b06dc1be6bf2",
    "cmd_type": "solid3d_fillet_edge"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "4c2e42fe-dc6c-44ae-b561-b1aeecb52099",
    "cmd_type": "enable_sketch_mode"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "6ea78590-5882-454a-bed4-b7fa72c4ed6a",
    "cmd_type": "start_path"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "4adc8f34-426d-49d7-8815-70bf88b0a726",
    "cmd_type": "move_path_pen"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "0f72afaa-2aa4-4dd4-bf8f-43dc3d21fa8c",
    "cmd_type": "extend_path"
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "cc919440-bc02-481d-b7ab-b5484e6fd373",
    "cmd_type": "close_path"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "extrude",
        "cap": true,
        "distance": 18,
        "target": "6ea78590-5882-454a-bed4-b7fa72c4ed6a"
      },
      "cmd_id": "eedd7a0a-783e-4d15-96e0-a9d8df4993d8"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "eedd7a0a-783e-4d15-96e0-a9d8df4993d8",
    "cmd_type": "extrude"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "sketch_mode_disable"
      },
      "cmd_id": "7bd6e8ee-36f5-4336-b64b-72a5634d4a81"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "7bd6e8ee-36f5-4336-b64b-72a5634d4a81",
    "cmd_type": "sketch_mode_disable"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "object_bring_to_front",
        "object_id": "6ea78590-5882-454a-bed4-b7fa72c4ed6a"
      },
      "cmd_id": "7ea58e34-f100-4d4c-a8b5-17189b22c9cb"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "empty"
        }
      }
    },
    "id": "7ea58e34-f100-4d4c-a8b5-17189b22c9cb",
    "cmd_type": "object_bring_to_front"
  },
  {
    "type": "send-modeling",
    "data": {
      "type": "modeling_cmd_req",
      "cmd": {
        "type": "solid3d_get_extrusion_face_info",
        "edge_id": "0f72afaa-2aa4-4dd4-bf8f-43dc3d21fa8c",
        "object_id": "2a1b652a-0055-4f02-9228-d6f57af67708"
      },
      "cmd_id": "eedd7a0a-783e-4d15-96e0-a9d8df4993d8"
    }
  },
  {
    "type": "receive-reliable",
    "data": {
      "type": "modeling",
      "data": {
        "modeling_response": {
          "type": "solid3d_get_extrusion_face_info",
          "data": {
            "faces": []
          }
        }
      }
    },
    "id": "eedd7a0a-783e-4d15-96e0-a9d8df4993d8",
    "cmd_type": "solid3d_get_extrusion_face_info"
  },
  {
    "type": "execution-done",
    "data": null
  }
]

One thing I noticed is that if you search for solid3d_fillet_edge there's only 4 results, 2 sends and 2 receives. This makes sense since we know as much that there's a get info endpoint that's not returning results, and because kcl doesn't have the ids that it needs, it never makes the second fillets calls to the engine.

@Irev-Dev
Copy link
Collaborator

Irev-Dev commented Apr 4, 2024

Screenshare.-.2024-04-04.3_02_51.PM.mp4

@adamchalmers
Copy link
Collaborator Author

Oh that's an interesting find, thank you Kurt.

@mlfarrell
Copy link
Contributor

mlfarrell commented Apr 4, 2024

expl-scaled.mp4

TL;DR - the engine isn't invalidating ids and is handling things correctly no matter the order of how the extrusions/fillets are done, so keep checking into the modeling-app/executor for the cause of this issue.

@jessfraz
Copy link
Contributor

jessfraz commented Apr 9, 2024

As a sanity check might be worth writing a test in the engine doing the exact same calls we are doing thats what i typically tend to do

@jessfraz
Copy link
Contributor

jessfraz commented Apr 9, 2024

I could be like we are exiting sketch mode or something subtle

@adamchalmers
Copy link
Collaborator Author

adamchalmers commented Apr 10, 2024

I've tried to copy the API calls that the modeling app makes, and turn them into an engine unit test here: https://github.com/KittyCAD/engine/pull/1977

Weirdly, it works fine in the engine test. So I either copied the calls wrong, omitting the modeling-app's mistake, or there's something weird going on beyond just the API calls.

Here's the debug prints from my latest commit on this PR. These debug prints show what modeling commands the app is sending to the engine. This was my guide for how to build the engine unit test.

Note that I did a find-and-replace for several important UUIDs which get referenced a lot, e.g. the UUID of the command which starts the 2D pentagon's path is replaced by PENTAGON_ID. Anything in all caps is the name of a UUID.


# Setup 


[ 2bb1c351-b74a-4a48-9dc4-5c47d0c8bf63: SetSceneUnits { unit: Cm }
, 144f65ce-78e7-4499-8258-0322f51233fe: MakePlane { clobber: false, hide: Some(true), origin: Point3D { x: 0.0, y: 0.0, z: 0.0 }, size: 60.0, x_axis: Point3D { x: 1.0, y: 0.0, z: 0.0 }, y_axis: Point3D { x: 0.0, y: 1.0, z: 0.0 } }
]

# Create pentagon 3D

[
, 9e2f6c0a-1960-4a23-ac08-e42555422262: SketchModeEnable { animated: false, disable_camera_with_plane: Some(Point3D { x: 0.0, y: 0.0, z: 1.0 }), ortho: false, plane_id: 144f65ce-78e7-4499-8258-0322f51233fe }
, PENTAGON_ID: StartPath
, 1f5a8d8e-b16e-4a23-aa53-7b10be35a8ca: MovePathPen { path: PENTAGON_ID, to: Point3D { x: -24.0, y: -24.0, z: 0.0 } }
, 37e44f77-cb67-4049-914a-e8371f47a853: ExtendPath { path: PENTAGON_ID, segment: Line { end: Point3D { x: 48.0, y: 0.0, z: 0.0 }, relative: true } }
, 3d52ada6-f637-475f-b2c3-2bec2b02b45b: ExtendPath { path: PENTAGON_ID, segment: Line { end: Point3D { x: 14.832815729997478, y: 45.65071278216737, z: 0.0 }, relative: true } }
, dec9ed14-d874-4d9c-bb9e-16276c2b18b1: ExtendPath { path: PENTAGON_ID, segment: Line { end: Point3D { x: -38.83281572999747, y: 28.213692110038714, z: 0.0 }, relative: true } }
, 7146cca8-b940-422a-a4f3-953164c3ebae: ExtendPath { path: PENTAGON_ID, segment: Line { end: Point3D { x: -38.83281572999748, y: -28.213692110038707, z: 0.0 }, relative: true } }
, 6bf03cf8-17c4-4ec7-a5a1-a2094c8d888a: ExtendPath { path: PENTAGON_ID, segment: Line { end: Point3D { x: 14.832815729997478, y: -45.65071278216737, z: 0.0 }, relative: true } }
 ]
[ 3624e927-11fd-4c93-a7e2-207a082f6539: Extrude { cap: true, distance: 30.0, target: PENTAGON_ID } ]
[ c4dfc8e4-4431-4dd1-a2b7-698e4e8f58f3: ObjectBringToFront { object_id: PENTAGON_ID } ]
[ 3624e927-11fd-4c93-a7e2-207a082f6539: Solid3DGetExtrusionFaceInfo { edge_id: 37e44f77-cb67-4049-914a-e8371f47a853, object_id: PENTAGON_ID } ]
Data: Solid3DGetExtrusionFaceInfo { faces: [
	ExtrusionFaceInfo { cap: None, curve_id: Some(37e44f77-cb67-4049-914a-e8371f47a853), face_id: Some(6b10d82c-b5ba-4d24-bc50-e9aa5ff1eb4e) }, 
	ExtrusionFaceInfo { cap: None, curve_id: Some(3d52ada6-f637-475f-b2c3-2bec2b02b45b), face_id: Some(51c6ab1a-5f96-4418-b3a5-514ae29a1e59) }, 
	ExtrusionFaceInfo { cap: None, curve_id: Some(dec9ed14-d874-4d9c-bb9e-16276c2b18b1), face_id: Some(4e7836a6-5e1b-4133-86b6-2e9dc65b6d0c) }, 
	ExtrusionFaceInfo { cap: None, curve_id: Some(7146cca8-b940-422a-a4f3-953164c3ebae), face_id: Some(2820a8cd-ef05-4e64-b3b8-eb1794bc8f5a) }, 
	ExtrusionFaceInfo { cap: None, curve_id: Some(6bf03cf8-17c4-4ec7-a5a1-a2094c8d888a), face_id: Some(380b0d21-15fa-4402-aa92-14dbed7a6ea2) }, 
	ExtrusionFaceInfo { cap: Bottom, curve_id: None, face_id: Some(2dd00aca-4441-49b4-a1ca-7731296e1eb7) }, 
	ExtrusionFaceInfo { cap: Top, curve_id: None, face_id: Some(1ce7feac-0201-459f-af6e-a0ee5dcfd84d) }
] }


# Create plumbus A


[ ffc7db0e-7e4b-431e-a82f-e7cf10dff4d2: EnableSketchMode { adjust_camera: false, animated: false, entity_id: 6b10d82c-b5ba-4d24-bc50-e9aa5ff1eb4e, ortho: false }
, CIRCLE_ON_FACE_A: StartPath
, 90b6636b-66a3-4e6f-88f0-7fb6bbf9253f: MovePathPen { path: CIRCLE_ON_FACE_A, to: Point3D { x: 9.0, y: 0.0, z: 0.0 } }
, ARC_A: ExtendPath { path: CIRCLE_ON_FACE_A, segment: Arc { center: Point2D { x: -0.0, y: -0.0 }, end: Angle { unit: Degrees, value: 360.0 }, radius: 9.0, relative: false, start: Angle { unit: Degrees, value: 0.0 } } }
, 53bb6674-ac5a-475e-ba2a-f8a40adfb0c2: ClosePath { path_id: CIRCLE_ON_FACE_A }
 ]
[ eccf4177-d6ea-419c-b139-141315e0e354: Extrude { cap: true, distance: 18.0, target: CIRCLE_ON_FACE_A } ]
[ 118bfcda-bd6e-47c3-9bd2-b7092f5cb1a3: SketchModeDisable ]
[ a9ad70da-fd85-4a2e-8df3-63c0cce2e546: ObjectBringToFront { object_id: CIRCLE_ON_FACE_A } ]
[ eccf4177-d6ea-419c-b139-141315e0e354: Solid3DGetExtrusionFaceInfo { edge_id: ARC_A, object_id: PENTAGON_ID } ]
Data: Solid3DGetExtrusionFaceInfo { faces: [
	ExtrusionFaceInfo { cap: None, curve_id: Some(ARC_A), face_id: Some(376eff92-8ac2-47bc-8b88-cc6f4acd2442) }, 
	ExtrusionFaceInfo { cap: Bottom, curve_id: None, face_id: Some(497f3254-c463-4cce-a79f-2a6cb52968ec) }, 
	ExtrusionFaceInfo { cap: Top, curve_id: None, face_id: Some(18252109-4d90-402f-84df-91915d1ea3be) }
] }

# Filleting plumbus A

[ 8c07df99-7471-4ed5-86ba-a3bc236f49cb: Solid3DGetOppositeEdge { edge_id: ARC_A, face_id: 376eff92-8ac2-47bc-8b88-cc6f4acd2442, object_id: PENTAGON_ID } ]
[ e904bdc8-0484-4988-ba7c-23e0bb0555c9: Solid3DFilletEdge { edge_id: ARC_A, object_id: PENTAGON_ID, radius: 0.5, tolerance: 1e-7 }
, 408efce5-9895-4cae-ae10-5fbc4e59833b: Solid3DFilletEdge { edge_id: e746c85b-fcb7-49cd-8926-4afe97f38a7d, object_id: PENTAGON_ID, radius: 0.5, tolerance: 1e-7 }
]

# Create plumbus B

[
, 7259d588-b865-4003-8920-e6ad346d1298: EnableSketchMode { adjust_camera: false, animated: false, entity_id: 51c6ab1a-5f96-4418-b3a5-514ae29a1e59, ortho: false }
, CIRCLE_ON_FACE_B: StartPath
, bb92dbb8-503e-4b6c-960c-aab5f7fdd147: MovePathPen { path: CIRCLE_ON_FACE_B, to: Point3D { x: 9.0, y: 0.0, z: 0.0 } }
, ARC_B: ExtendPath { path: CIRCLE_ON_FACE_B, segment: Arc { center: Point2D { x: -0.0, y: -0.0 }, end: Angle { unit: Degrees, value: 360.0 }, radius: 9.0, relative: false, start: Angle { unit: Degrees, value: 0.0 } } }
, 2d1b3944-b91d-4fad-a4b2-564c4cd058ad: ClosePath { path_id: CIRCLE_ON_FACE_B }
 ]
[ 946b1e8a-8ebc-472e-bfb7-c5092b6bb7cb: Extrude { cap: true, distance: 18.0, target: CIRCLE_ON_FACE_B } ]
[ 523678cb-8fda-4a65-99a1-849c71a44ffb: SketchModeDisable ]
[ fe457fae-9773-41b2-9aca-39f38e6f4bed: ObjectBringToFront { object_id: CIRCLE_ON_FACE_B } ]
[ 946b1e8a-8ebc-472e-bfb7-c5092b6bb7cb: Solid3DGetExtrusionFaceInfo { edge_id: ARC_B, object_id: PENTAGON_ID } ]
Data: Solid3DGetExtrusionFaceInfo { faces: [] }

@adamchalmers
Copy link
Collaborator Author

adamchalmers commented May 14, 2024

OK, I think this is a bug related to defining sketches in functions. The plumbuses can be filletted just fine as long as the make_circle function is inlined. Here's a video explaining exactly how to trigger or fix the bug.

inlining_make_circle.mp4

@adamchalmers
Copy link
Collaborator Author

weird_plumbus_behaviour.mp4

Signed-off-by: Jess Frazelle <github@jessfraz.com>
@adamchalmers
Copy link
Collaborator Author

Fixed in #2474

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JS parser craps out when modifying complex kcl
4 participants