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

<Edges> doesn't support geometry prop anymore after v9.102.0 #1893

Closed
TimKraemer opened this issue Mar 25, 2024 · 4 comments · Fixed by #1978
Closed

<Edges> doesn't support geometry prop anymore after v9.102.0 #1893

TimKraemer opened this issue Mar 25, 2024 · 4 comments · Fixed by #1978
Labels
bug Something isn't working released

Comments

@TimKraemer
Copy link
Contributor

  • @react-three/drei version: ^9.102.0

Problem description:

eda9829 breaks geometry prop as documented in https://github.com/pmndrs/drei#edges

Relevant code:

I'm using <Edges> like this and would like to keep using it with a geometry prop:

      <Edges
        geometry={
          new BoxGeometry(
            dimensions.x + PADDING_IN_METER,
            dimensions.y + PADDING_IN_METER / 2,
            dimensions.z + PADDING_IN_METER
          )
        }
		...
      >
        <lineBasicMaterial
          color="#ff0a82"
          castShadow="false"
        />
      </Edges>

Suggested solution:

I tried fixing it with:

// src/core/Edges.tsx
const geometry = ref.current.geometry ?? parent.geometry

but this results in a lot more errors down the line, which I'm currently not able to solve

@TimKraemer TimKraemer added the bug Something isn't working label Mar 25, 2024
@CodyJasonBennett
Copy link
Member

@drcmda, what was the point of eda9829?

@Kalabedo
Copy link

Kalabedo commented Apr 4, 2024

Hey, i use Edges in my project, since the update when i export my scene i get this:

grafik

caused by Edges (before there was no white plane). Is this the same problem?
Before it worked fine. Is there a fix, other then remove the Edges before exporting?

Greetings Tom

Copy link

🎉 This issue has been resolved in version 9.107.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@TimKraemer
Copy link
Contributor Author

TimKraemer commented Jun 26, 2024

Thank you @nickthegroot for the fix!
It does accept geometries - however a custom lineBasicMaterial seem to be ignored:

<Edges
  geometry={
    new BoxGeometry(1,1,1)
    )
  }
  ...
>
  <lineBasicMaterial linewidth="5" color="#ff0000" />
</Edges>

Edit:
custom <lineBasicMaterial /> is not needed anymore. A at least not for my example to set linewidth and color - it can just be set directly as parameters to <Edges>:

<Edges
  geometry={
    new BoxGeometry(1,1,1)
    )
  }
  linewidth="5" 
  color="#ff0000"
  ...
/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants