Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Face-me component transformations are not valid when an instance has more than one instance path #732

Open
noelwarren opened this issue Oct 29, 2021 · 2 comments

Comments

@noelwarren
Copy link

This affects all versions of SketchUp

In this model Sumelle is nested in a component that is instanced twice
image

There are two instance paths for sumelle
[instance_a, sumelle]
[instance_b, sumelle]

The ComponentInstance#transformation method cannot return a tranformation for sumelle that is correct for both instance paths. The InstancePath::transformation method could, since it has the necessary context. But it doesn't. This is the bug.

The following example gets instance path transforms for the two sumelles. The should be roughly pointing in the same direction as they both face the camera, but as you can see they are not.
Untitled.zip

# Using attached model
Sketchup.active_model.entities.map { |stand|
  Sketchup::InstancePath.new([stand, stand.definition.entities.to_a.first]).transformation.to_a
}
#[-0.9876782389772898, -0.15649823082297007, 0.0, 0.0, 0.15649823082297007, -0.9876782389772898, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, -14.999999999999984, -25.0, 0.0, 1.0]
#[0.9876782389772898, 0.15649823082297018, 0.0, 0.0, -0.15649823082297018, 0.9876782389772898, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 19.249999999999986, -12.819118387212601, 0.0, 1.0]

Because of this we are unable to fully support face me components in our renderer
image

@noelwarren noelwarren changed the title Face Me component transformations are not valid when an instance has more than one instance path Face-me component transformations are not valid when an instance has more than one instance path Oct 29, 2021
@thomthom
Copy link
Member

thomthom commented Nov 1, 2021

Internal note: While not exactly the same, it's worth considering that we also have issue with providing correct transformations for instances outside the open context.

@sketchupbot
Copy link

Logged as: SKEXT-3266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants