Modify Extruded Geometry

Hello,
I would like to model mouldings for picture frame in 3d, and got pretty excited about the ExtrudeGeometry feature.
Using it would allow me to simply model the profile once and create the 3d moulding by extruding the profile.
Here are what profiles could look like:

Now to model the full frame (made up of four intersecting mouldings) seems like I can go multiple ways:

  • Extrude along a rectangular path (which sounds like it’s not so easy.)
  • Make 4 of those meshes, size and position them in an Object3d, then texture them probably using DecalGeometry.

The tricky thing is that the intersecting corners should reflect the actual intersection like so:
Screenshot from 2020-05-14 17-06-20

Seems to me like I have no choice but to slice each ends of meshes at a 45 degree angle to obtain the best result.
What is the best way to achieve that?

Might be worth checking these posts:
https://discourse.threejs.org/t/simple-rectangular-geometry-extrusion-anyone
https://discourse.threejs.org/t/profiledcontourgeometry
https://discourse.threejs.org/t/any-better-implementation-of-extrudegeometry

1 Like

try :slightly_smiling_face:

https://hofk.de/main/discourse.threejs/2019/ProfiledContourGeometryMM/ProfiledContourGeometryMM.html

from Collection of examples from discourse.threejs.org


Construction of frames with contour/profile
threejsResources/ConstructFrame at master · hofk/threejsResources · GitHub

1 Like

Thanks to @prisoner849’s ProfiledContourGeometry I have been able to achieve the desired effect.
Many thanks for that code.

Screenshot from 2020-05-27 15-39-18

Now I have been looking at how to apply a texture to the front facing faces of the frame and boy does it look complicated.
I basically would have to control where the mapping begins, where it ends, follow the planes in between, scale it to the right dimensions and eventually repeat it (programatically).

Any good resources to learn how to do that?
Would a DecalGeometry be easier in this case?

Thanks

Look there ProfiledContourGeometry MultiMaterial - #2 by hofk

Wow Bob. This looks great. I was wondering if you would share your final result code. I am a hobbyist and would like to play around with this.

1 Like

recording (1).mkv (915.8 KB)
This is the image, i want to achieve trying to create a dynamic drawing tool where users click to define a shape, and then the shape is extruded along the drawn lines to form a window-like structure.

Click to Define Shape: Users click to define the shape of a window frame.Auto-Complete Shape: Once the user completes the shape by clicking near the starting point, the shape should close.Extrude Along Drawn Lines: The shape should be extruded along the clicked path to create a 3D window frame.Ensure Proper Angles and Transformations: The frame edges should have correct angles for a realistic window frame.