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

add bevel and second material support #496

Merged
merged 6 commits into from
Mar 27, 2024
Merged

add bevel and second material support #496

merged 6 commits into from
Mar 27, 2024

Conversation

Algorush
Copy link
Collaborator

@Algorush Algorush commented Mar 6, 2024

No description provided.

Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for 3dstreet-core-builds ready!

Name Link
🔨 Latest commit 9b80ce6
🔍 Latest deploy log https://app.netlify.com/sites/3dstreet-core-builds/deploys/65eb3ed46e08090008beafbc
😎 Deploy Preview https://deploy-preview-496--3dstreet-core-builds.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kfarr
Copy link
Collaborator

kfarr commented Mar 7, 2024

hey @Algorush

  • using thie repo I am loading this file [1]

here is result - now all svg extrude elements have a grass top face
image

Then I set bevelEnabled and topElement default to false and the scene loaded as expected

Then I edited the scene and on the svg path - circle bioswale layer I set bevelEnabled and topElement to true:

  • I noticed that once topElement is set to true in the Editor, even when setting to false the topElement face is still visible

Then I saved the file into a new json file and reloaded. Then I noticed that the bevel has a grass texture instead of concrete
image

Here is the new json file
test-file-after-enable-bevel-and-top-element.json

[1] svg-test-file-data.json

@Algorush
Copy link
Collaborator Author

Algorush commented Mar 8, 2024

I fixed issue with visible topLevel in false.

Then I saved the file into a new json file and reloaded. Then I noticed that the bevel has a grass texture instead of concrete

It happen because JSON saved with material component from previous version of svg-extruder. And this material is applied to element. Quick solution - remove material component string from JSON in this element. And after that you will need to assign texture links again through the src parameter, like #grass-texture, #seamless-sidewalk, etc.
And also should I make cleaning material data in init function of svg-extruder?
I also think that I need to add a repeat property for the material in the component settings. Because not all textures have the same scale. But won't there already be too many properties?

@Algorush
Copy link
Collaborator Author

Algorush commented Mar 27, 2024

A short guide to the svg-extruder component.
depth - float. Depth to extrude the shape. Default is 4.
bevelEnabled - bool. Apply beveling to the shape. Default is false.
bevelThickness - float. How deep into the original shape the bevel goes. Default is 1.
bevelSize - float. Distance from the shape outline that the bevel extends. Default is bevelThickness - 1.
bevelOffset - float. Distance from the shape outline that the bevel starts. Default is 1.
bevelSegments - int. Number of bevel layers. Default is 1.
topElement - bool. Add a separate top element - covering. default is false.
color - type: 'color'. Top element color, coating. Default is 'grey'.
src - string. Address of the link to the texture html element for the top element, cover. Default is '#grass-texture'.
bevelColor - type: 'color'. Color of extruded element. Default is 'white'.
bevelSrc - string. Address of the texture for the extruded element.
lineColor - type: 'color'. Border line color.
If old scenes contain a version of the svg-extruder component without bevel and topElement, their materials will not be applied to the new version of the component. You need to reassign the src of texture for the top (covering) and for the extruded element (border)

@kfarr
Copy link
Collaborator

kfarr commented Mar 27, 2024

Thanks! This is looking great:
image

@kfarr kfarr merged commit 2dccef9 into main Mar 27, 2024
6 checks passed
@kfarr kfarr deleted the bevel-option-svg-extrude branch March 29, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants