2D or Not 2D
campedersen.com·16h·
Discuss: Hacker News
🎨Graphics Programming
Preview
Report Post

Tonight I shipped cylinder booleans. Subtracting cylinders from boxes to make holes. Classic CAD operation.

The problem: a cylinder intersects a cube’s face along a circle. Circles in 3D are annoying. No start, no end, curving through space. Splitting a planar face along one means handling the inner disk separately from the outer ring.

The answer is UV space.

parameter space

Every surface in CAD has a 2D coordinate system that maps to points on the 3D surface. We call the coordinates uu and vv because xx, yy, zz are taken.

A cylinder is just a rectangle that got rolled up:

  • uu goes around the circumference (00 to 2π2\pi)
  • vv goes up the height

The surface equation:

P(u,v)=center+r⋅(cos⁡(u)⋅x^+sin⁡(u)⋅y^)+v⋅axisP(…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help