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

Errors can cause default planes to show #5783

Open
Irev-Dev opened this issue Mar 13, 2025 · 0 comments
Open

Errors can cause default planes to show #5783

Irev-Dev opened this issue Mar 13, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Irev-Dev
Copy link
Collaborator

Irev-Dev commented Mar 13, 2025

We display default planes in new/empty scenes to give the user some kind of 3d reference since there's nothing else to look at.

The problem is that the way we detect this I think is if the artifactGraph is empty, and when there's an error the artifactGraph is empty (caveat, this might change with keep-on-trucking-execution). So I think the trigger for showing the default planes needs to be sceneIsEmpty && noErrors.

Here's an example of a model where the planes show when they probably should not (if you change the fillet at the bottom to radius = 0.1 than the error goes away)

A good place to start looking is in part of the xstate diagram

Image

search for { type: 'Artifact graph populated' } in the codebase

axisJ2 = 110
axisJ1 = 90
axisJ2ArmLength = 31
axisJ2ArmWidth = 4
axisJ2ArmThickness = 2.5

// Define Plane to Move J2 Axis Robot Arm
plane003 = {
  plane = {
    origin = [-0.1, 0.0, 0.0],
    xAxis = [
      sin(toRadians(axisJ1)),
      cos(toRadians(axisJ1)),
      0.0
    ],
    yAxis = [0.0, 0.0, 1.0],
    zAxis = [1.0, 0.0, 0.0]
  }
}

// Create Body of J2 Robot Arm
sketch011 = startSketchOn(plane003)
  |> startProfileAt([
       1.75 - (axisJ2ArmWidth / 2 * sin(toRadians(axisJ2))),
       8 + axisJ2ArmWidth / 2 * cos(toRadians(axisJ2))
     ], %)
  |> arc({
       angleStart = 90 + axisJ2,
       angleEnd = 270 + axisJ2,
       radius = axisJ2ArmWidth / 2
     }, %)
  |> angledLine({
       angle = axisJ2,
       length = axisJ2ArmLength
     }, %)
  |> arc({
       angleStart = -90 + axisJ2,
       angleEnd = 90 + axisJ2,
       radius = axisJ2ArmWidth / 2
     }, %)
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
  |> close(%)
extrude011 = extrude(sketch011, length = -axisJ2ArmThickness)

sketch012 = startSketchOn(extrude011, 'START')
  |> circle(center = [-1.75, 8], radius = 1.9, tag = $referenceEdge4)

extrude012 = extrude(sketch012, length = 0.15)
  |> fillet(
       radius = 1,
       tags = [getOppositeEdge(referenceEdge4)]
     )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants