Skip to content

Can't get the spacing for mousebite holes right #725

Answered by yaqwsx
armands256 asked this question in Q&A
Discussion options

You must be logged in to vote

The spacing is slightly adjusted so:

  • there an integral number of holes and
  • they are evenly spaced and
  • they cover the whole cut.

See the full algorithm:

KiKit/kikit/panelize.py

Lines 1546 to 1557 in ec75c91

self.renderedMousebiteCounter += 1
length = cut.length
count = int(length / spacing) + 1
for i in range(count):
if count == 1:
hole = cut.interpolate(0.5, normalized=True)
else:
hole = cut.interpolate( i * length / (count - 1) )
if bloatedSubstrate.intersects(hole):
self.addNPTHole(toKiCADPoint((hole.x, hole.y)), diameter,
ref=f"KiKit_MB_{self.renderedMousebiteCounter}_{i+1}",
excludedFromPos=True)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@armands256
Comment options

Answer selected by armands256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants