Skip to content

edgeId function selects edge randomly #11415

@bcorey

Description

@bcorey

Describe the bug

The edgeId function selects one of two edges at random on model regen.

Steps to Reproduce

  1. Paste the supplied KCL into zoo design studio.
  2. Change the arguments in the chamfer call that produces chamfer002
  3. move the chamfer & edgeId call before or after the commented lines preceding it
  4. Observe that the chamfered edge toggles between two edges sometimes and stays put until the next change.

Expected Behavior

No matter how many times the model regens, no matter where comments are placed, no matter what angle is input to the chamfer call, the edge that gets chamfered should be the same edge.

Screenshots and Recordings

Image Image

Desktop OS

MacOS 26.3.1

Browser

No response

Version

1.2.6

Additional Context

couldn't report in zoo forum due to attachment limit for new users.

KCL:

frontProfile = sketch(on = XZ) {
  line1 = line(start = [var 0mm, var 0mm], end = [var 0mm, var 60mm])
  coincident([line1.start, ORIGIN])
  vertical([line1.end, ORIGIN])
  line2 = line(start = [var 0mm, var 60mm], end = [var -29.04mm, var 57.46mm])
  coincident([line2.start, line1.end])
  line3 = line(start = [var -29.04mm, var 57.46mm], end = [var -36mm, var 18mm])
  coincident([line2.end, line3.start])
  line4 = line(start = [var -36mm, var 18mm], end = [var -30.71mm, var -12mm])
  coincident([line3.end, line4.start])
  line5 = line(start = [var -30.71mm, var -12mm], end = [var -25mm, var -12mm])
  coincident([line4.end, line5.start])
  line6 = line(start = [var -25mm, var -12mm], end = [var -25mm, var 0mm])
  coincident([line5.end, line6.start])
  horizontal([line6.end, ORIGIN])
  line7 = line(start = [var 0mm, var 0mm], end = [var -25mm, var 0mm])
  coincident([line7.start, line1.start])
  coincident([line7.end, line6.end])
  vertical(line6)
  angle([line1, line2]) == 95
  distance([line1.start, line1.end]) == 60
  line8 = line(start = [var -36mm, var 18mm], end = [var 0mm, var 18mm], construction = true)
  coincident([line8.start, line4.start])
  vertical([line8.end, ORIGIN])
  horizontal(line8)
  coincident([line8.end, line1])
  distance([line8.start, line8.end]) == 36
  distance([line7.start, line7.end]) == 25
  angle([line3, line8]) == 100
  distance([line6.start, line6.end]) == 12
  horizontal(line5)
  angle([line4, line8]) == 80
  distance([line8.end, line7.start]) == 18
}
sideProfile = sketch(on = -YZ) {
  line1 = line(start = [var 0mm, var -12.42mm], end = [var 135mm, var -12.42mm])
  vertical([line1.start, ORIGIN])
  line2 = line(start = [var 135mm, var -12.42mm], end = [var 135mm, var 52.95mm])
  coincident([line1.end, line2.start])
  line3 = line(start = [var 135mm, var 52.95mm], end = [var 100mm, var 60.27mm])
  coincident([line2.end, line3.start])
  line4 = line(start = [var 100mm, var 60.27mm], end = [var 0mm, var 60.27mm])
  coincident([line3.end, line4.start])
  vertical([line4.end, ORIGIN])
  line5 = line(start = [var 0mm, var -12.42mm], end = [var 0mm, var 60.27mm])
  coincident([line5.start, line1.start])
  coincident([line5.end, line4.end])
  distance([line5.start, line5.end]) == 72.69mm
  vertical(line5)
  horizontal(line4)
  horizontal(line1)
  vertical(line2)
  distance([line4.start, line4.end]) == 100
  distance([line1.start, line1.end]) == 135
  distance([line2.start, line2.end]) == 65.37mm
}
hidden001 = hide(frontProfile)
region001 = region(point = [-0.0025mm, 30mm], sketch = frontProfile)
extrude001 = extrude(region001, length = 135, tagStart = $capStart001)
hidden002 = hide(sideProfile)
region002 = region(point = [59.38mm, -12.4195mm], sketch = sideProfile)
extrude002 = extrude(region002, length = 100)
solid001 = intersect([extrude002, extrude001])

edge001 = edgeId(solid001, index = 17)
chamfer001 = chamfer(
  solid001,
  tags = edge001,
  length = 5,
  angle = 75deg,
)

// surface001 = deleteFace(solid001, faces = region001.tags.line1)
// surface002 = deleteFace(solid001, faces = capStart001)
// doorProfile = sketch(on = -YZ) {
// line1 = line(start = [var 45mm, var 52mm], end = [var 80mm, var 52mm])
// line2 = line(start = [var 80mm, var 52mm], end = [var 80mm, var 2mm])
// line3 = line(start = [var 80mm, var 2mm], end = [var 45mm, var 2mm])
// line4 = line(start = [var 45mm, var 2mm], end = [var 45mm, var 52mm])
// coincident([line1.end, line2.start])
// coincident([line2.end, line3.start])
// coincident([line3.end, line4.start])
// coincident([line4.end, line1.start])
// parallel([line2, line4])
// parallel([line3, line1])
// perpendicular([line1, line2])
// horizontal(line3)
// distance([line4.start, line4.end]) == 50
// distance([line1.start, line1.end]) == 35
// line5 = line(start = [var 0mm, var 0mm], end = [var 45mm, var 0mm], construction = true)
// coincident([line5.start, ORIGIN])
// horizontal(line5)
// distance([line5.start, line5.end]) == 45
// line6 = line(start = [var 45mm, var 2mm], end = [var 45mm, var 0mm], construction = true)
// coincident([line6.start, line4.start])
// coincident([line6.end, line5.end])
// vertical(line6)
// distance([line6.start, line6.end]) == 2
// line7 = line(start = [var 36.94mm, var 51.93mm], end = [var 0mm, var 51.93mm])
// line8 = line(start = [var 9.91mm, var 52mm], end = [var 9.91mm, var 25.48mm])
// line9 = line(start = [var 0mm, var 25.48mm], end = [var 36.94mm, var 25.48mm])
// coincident([line7.end, line8.start])
// coincident([line8.end, line9.start])
// parallel([line9, line7])
// perpendicular([line7, line8])
// horizontal(line9)
// line10 = line(start = [var 36.94mm, var 51.93mm], end = [var 36.94mm, var 25.48mm])
// coincident([line10.start, line7.start])
// coincident([line10.end, line9.end])
// line11 = line(start = [var 37mm, var 52mm], end = [var 45mm, var 52mm], construction = true)
// coincident([line11.start, line10.start])
// coincident([line11.end, line4.end])
// horizontal(line11)
// vertical(line10)
// distance([line8.start, line8.end]) == 25
// distance([line11.start, line11.end]) == 8
// line12 = line(start = [var -0mm, var -0mm], end = [var 0mm, var 51.9mm], construction = true)
// coincident([line12.start, line5.start])
// vertical([line12.end, ORIGIN])
// line13 = line(start = [var 0mm, var 52mm], end = [var 4.95mm, var 52mm], construction = true)
// coincident([line13.start, line12.end])
// coincident([line13.end, line7.end])
// horizontal(line13)
// equalLength([line13, line11])
// line14 = line(start = [var 80mm, var 52mm], end = [var 88mm, var 52mm], construction = true)
// coincident([line14.start, line2.start])
// horizontal(line14)
// equalLength([line14, line11])
// line15 = line(start = [var 88mm, var 52mm], end = [var 118.24mm, var 52mm])
// line16 = line(start = [var 118.24mm, var 52mm], end = [var 118.24mm, var 23.53mm])
// line17 = line(start = [var 118.24mm, var 23.53mm], end = [var 88mm, var 23.53mm])
// line18 = line(start = [var 88mm, var 23.53mm], end = [var 88mm, var 52mm])
// coincident([line15.end, line16.start])
// coincident([line16.end, line17.start])
// coincident([line17.end, line18.start])
// coincident([line18.end, line15.start])
// parallel([line16, line18])
// parallel([line17, line15])
// perpendicular([line15, line16])
// horizontal(line17)
// coincident([line15.start, line14.end])
// equalLength([line18, line10])
// distance([line17.start, line17.end]) == 30.24mm
// }
// region003 = region(point = [62.5mm, 51.9975mm], sketch = doorProfile)
// windowRegion = region(point = [20mm, 51.9975mm], sketch = doorProfile)
// endWindowRegion = region(point = [100mm, 51.9975mm], sketch = doorProfile)
// extrude003 = extrude(
// [
// region003,
// windowRegion,
// endWindowRegion
// ],
// length = 100,
// tagEnd = $capEnd001,
// tagStart = $capStart002,
// )
// split001 = split(solid001, tools = extrude003)


// face001 = faceId(split001[1], index = 0)
// surface003 = deleteFace(split001[1], faces = face001)
// face002 = faceId(split001[1], index = 0)

// MOVE THESE LINES BEFORE ABOVE COMMENT, or tweak chamfer args.
edge002 = edgeId(solid001, index = 20)
chamfer002 = chamfer(solid001, tags = edge002, length = 3, angle = 25deg)


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions