Skip to content

Commit

Permalink
Temporally fix AOV for over inf
Browse files Browse the repository at this point in the history
  • Loading branch information
monman53 committed Jun 14, 2024
1 parent 2650adb commit a1b3596
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions src/SVG/Guideline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,19 @@ const aov = computed(() => {
const focalPlaneTop = vec(focal.value.x, -focal.value.d)
const focalPlaneBottom = vec(focal.value.x, focal.value.d)
const inner = focalPlaneTop.sub(lensTop).normalize().mul(infR.value)
const outer = focalPlaneBottom.sub(lensTop).normalize().mul(infR.value)
const middleOuter = focalPlaneTop.sub(lensTop)
const middleInner = focalPlaneBottom.sub(lensTop)
return { inner, outer }
const inner = middleOuter.copy().normalize().mul(infR.value)
const outer = middleInner.copy().normalize().mul(infR.value)
// Over infinity
if (lens.value.x + lens.value.f > sensor.value.x) {
middleOuter.minus().normalize().mul(infR.value)
middleInner.minus().normalize().mul(infR.value)
}
return { middleInner, middleOuter, inner, outer }
})
// Depth of field
Expand Down Expand Up @@ -75,18 +84,23 @@ const dof = computed(() => {
<line :x1="sensor.x" :y1="-sensor.r" :x2="lens.x" :y2="-re" class="dotted-bg"></line>
<line :x1="sensor.x" :y1="sensor.r" :x2="lens.x" :y2="re" class="dotted"></line>
<line :x1="sensor.x" :y1="-sensor.r" :x2="lens.x" :y2="-re" class="dotted"></line>
<!-- Lens to focal plane (outer) -->
<line :x1="lens.x" :y1="-re" :x2="lens.x + aov.middleOuter.x" :y2="-re + aov.middleOuter.y" class="dotted-bg">
</line>
<line :x1="lens.x" :y1="re" :x2="lens.x + aov.middleOuter.x" :y2="re - aov.middleOuter.y" class="dotted-bg"></line>
<line :x1="lens.x" :y1="-re" :x2="lens.x + aov.middleOuter.x" :y2="-re + aov.middleOuter.y" class="dotted"></line>
<line :x1="lens.x" :y1="re" :x2="lens.x + aov.middleOuter.x" :y2="re - aov.middleOuter.y" class="dotted"></line>
<!-- Lens to focal plane (inner) -->
<line :x1="lens.x" :y1="-re" :x2="lens.x + aov.middleInner.x" :y2="-re + aov.middleInner.y" class="dotted-thick-bg">
</line>
<line :x1="lens.x" :y1="re" :x2="lens.x + aov.middleInner.x" :y2="re - aov.middleInner.y" class="dotted-thick-bg">
</line>
<line :x1="lens.x" :y1="-re" :x2="lens.x + aov.middleInner.x" :y2="-re + aov.middleInner.y" class="dotted-thick">
</line>
<line :x1="lens.x" :y1="re" :x2="lens.x + aov.middleInner.x" :y2="re - aov.middleInner.y" class="dotted-thick">
</line>
<!-- Non over infinity -->
<g v-if="lens.x + lens.f < sensor.x">
<!-- Lens to focal plane (outer) -->
<line :x1="focal.x" :y1="-focal.d" :x2="lens.x" :y2="-re" class="dotted-bg"></line>
<line :x1="focal.x" :y1="focal.d" :x2="lens.x" :y2="re" class="dotted-bg"></line>
<line :x1="focal.x" :y1="-focal.d" :x2="lens.x" :y2="-re" class="dotted"></line>
<line :x1="focal.x" :y1="focal.d" :x2="lens.x" :y2="re" class="dotted"></line>
<!-- Lens to focal plane (inner) -->
<line :x1="focal.x" :y1="-focal.d" :x2="lens.x" :y2="re" class="dotted-thick-bg"></line>
<line :x1="focal.x" :y1="focal.d" :x2="lens.x" :y2="-re" class="dotted-thick-bg"></line>
<line :x1="focal.x" :y1="-focal.d" :x2="lens.x" :y2="re" class="dotted-thick"></line>
<line :x1="focal.x" :y1="focal.d" :x2="lens.x" :y2="-re" class="dotted-thick"></line>
<!-- Focal plane -->
<line :x1="focal.x" :y1="-focal.d" :x2="focal.x" :y2="focal.d" class="dotted-bg"></line>
<line :x1="focal.x" :y1="-focal.d" :x2="focal.x" :y2="focal.d" class="dotted"></line>
Expand Down

0 comments on commit a1b3596

Please sign in to comment.