Stabilize the position of a sphere when changing its curvature #101

Open
opened 2025-07-18 22:42:42 +00:00 by Vectornaut · 2 comments
Member

Desired behavior

Let's say a sphere is "roundish" if it's curved enough for most of it to fit on the screen, and "flattish" if its curvature is so small that only a small part of it fits on the screen.

  • When you change the curvature of a roundish sphere which is otherwise unconstrained, the center of the sphere should stay in the same place.
  • When you change an otherwise unconstrained sphere from roundish to flattish, it should end up more or less passing through its old location.
  • When you change an otherwise unconstrained sphere from flattish to roundish, it should end up in a reasonable location that more or less lies on its old surface.

Old implementation

Ever since curvature regulators were introduced in pull request #80, setting or changing the curvature of a sphere has triggered a preconditioning step that happens before realization. This step provides the behavior described above, but it's unsatisfactory in several ways:

  • It makes the reactive realization system hard to maintain.
    • For example, it makes it hard to ensure that batched updates will only trigger a single realization.
  • Its effectiveness depends on quirks of the reactivity system and realization routine.
    • The preconditioning and realization steps are both Sycamore effects, and it's not clear that they'll always run in the desired order.
    • Preconditioning works by choosing a good initial guess for realization, but the realization routine doesn't currently strive for any particular relationship between the guess it starts with and the realization it finds.

We therefore intend to remove the preconditioning step in an upcoming pull request.

### Desired behavior Let's say a sphere is "roundish" if it's curved enough for most of it to fit on the screen, and "flattish" if its curvature is so small that only a small part of it fits on the screen. - When you change the curvature of a roundish sphere which is otherwise unconstrained, the center of the sphere should stay in the same place. - When you change an otherwise unconstrained sphere from roundish to flattish, it should end up more or less passing through its old location. - When you change an otherwise unconstrained sphere from flattish to roundish, it should end up in a reasonable location that more or less lies on its old surface. ### Old implementation Ever since curvature regulators were introduced in pull request #80, setting or changing the curvature of a sphere has triggered a preconditioning step that happens before realization. This step provides the behavior described [above](#desired-behavior), but it's unsatisfactory in several ways: - It makes the reactive realization system hard to maintain. - For example, it makes it hard to ensure that batched updates will only trigger a single realization. - Its effectiveness depends on quirks of the reactivity system and realization routine. - The preconditioning and realization steps are both Sycamore effects, and it's not clear that they'll always run in the desired order. - Preconditioning works by choosing a good initial guess for realization, but the realization routine doesn't currently strive for any particular relationship between the guess it starts with and the realization it finds. We therefore intend to remove the preconditioning step in an upcoming pull request.
Vectornaut added the
enhancement
prospective
ui
labels 2025-07-18 22:42:42 +00:00
Owner

Conversely when you adjust the location of any sphere, its curvature should remain constant insofar as consistent with the assembly.

Conversely when you adjust the location of any sphere, its curvature should remain constant insofar as consistent with the assembly.
Author
Member

@glen wrote in #101 (comment):

Conversely when you adjust the location of any sphere, its curvature should remain constant insofar as consistent with the assembly.

Right! I was planning to file this as a separate issue so we can work on it separately, in case that's more convenient. It would be nice if we could address both issues in the same way, though. Issue #42 is related, but I don't think it has quite the same spirit.

@glen wrote in https://code.studioinfinity.org/StudioInfinity/dyna3/issues/101#issuecomment-3052: > Conversely when you adjust the location of any sphere, its curvature should remain constant insofar as consistent with the assembly. Right! I was planning to file this as a separate issue so we can work on it separately, in case that's more convenient. It would be nice if we could address both issues in the same way, though. Issue #42 is related, but I don't think it has quite the same spirit.
Sign in to join this conversation.
No description provided.