Skip to main content
deleted 2 characters in body
Source Link
Greg Hurst
  • 39.3k
  • 1
  • 101
  • 147

With a bit more work, we can take a similar approach to J.M.'s answer to build a (waterwater tight) model with a base.

text = BoundaryDiscretizeGraphics[Text["Hello"], _Text] 

enter image description here

elongate[{a_, b_}] := With[{d = 0.05 (b - a)}, {a - d, b + d}] full = DiscretizeGraphics[Rectangle @@ Transpose[elongate /@ RegionBounds[text]]] 

enter image description here

diff = RegionDifference[full, text] 

enter image description here

etext = RegionProduct[RegionBoundary[text], Line[{{0.}, {2.}}]] 

enter image description here

final = DiscretizeGraphics @ Show[ etext, RegionProduct[text, Point[{2.}]], RegionProduct[diff, Point[{0.}]], RegionProduct[full, Point[{-1.}]], RegionProduct[RegionBoundary[full], Line[{{-1.}, {0.}}]] ] 

enter image description here

The only defects here are misoriented faces (which can be fixed with RepairMesh), but this is indeed a water tight model:

FindMeshDefects[final] 

enter image description here

With a bit more work, we can take a similar approach to J.M.'s answer to build a (water tight) model with a base.

text = BoundaryDiscretizeGraphics[Text["Hello"], _Text] 

enter image description here

elongate[{a_, b_}] := With[{d = 0.05 (b - a)}, {a - d, b + d}] full = DiscretizeGraphics[Rectangle @@ Transpose[elongate /@ RegionBounds[text]]] 

enter image description here

diff = RegionDifference[full, text] 

enter image description here

etext = RegionProduct[RegionBoundary[text], Line[{{0.}, {2.}}]] 

enter image description here

final = DiscretizeGraphics @ Show[ etext, RegionProduct[text, Point[{2.}]], RegionProduct[diff, Point[{0.}]], RegionProduct[full, Point[{-1.}]], RegionProduct[RegionBoundary[full], Line[{{-1.}, {0.}}]] ] 

enter image description here

The only defects here are misoriented faces (which can be fixed with RepairMesh), but this is indeed a water tight model:

FindMeshDefects[final] 

enter image description here

With a bit more work, we can take a similar approach to J.M.'s answer to build a water tight model with a base.

text = BoundaryDiscretizeGraphics[Text["Hello"], _Text] 

enter image description here

elongate[{a_, b_}] := With[{d = 0.05 (b - a)}, {a - d, b + d}] full = DiscretizeGraphics[Rectangle @@ Transpose[elongate /@ RegionBounds[text]]] 

enter image description here

diff = RegionDifference[full, text] 

enter image description here

etext = RegionProduct[RegionBoundary[text], Line[{{0.}, {2.}}]] 

enter image description here

final = DiscretizeGraphics @ Show[ etext, RegionProduct[text, Point[{2.}]], RegionProduct[diff, Point[{0.}]], RegionProduct[full, Point[{-1.}]], RegionProduct[RegionBoundary[full], Line[{{-1.}, {0.}}]] ] 

enter image description here

The only defects here are misoriented faces (which can be fixed with RepairMesh), but this is indeed a water tight model:

FindMeshDefects[final] 

enter image description here

deleted 46 characters in body
Source Link
Greg Hurst
  • 39.3k
  • 1
  • 101
  • 147

With a bit more work, we can take a similar approach to J.M.'s answer to build a (water tight) model with a base.

text = BoundaryDiscretizeGraphics[Text["Hello"], _Text] 

enter image description here

elongate[{a_, b_}] := With[{d = 0.05 (b - a)}, {a - d, b + d}] full = DiscretizeGraphics[Rectangle @@ Transpose[elongate /@ RegionBounds[text]]] 

enter image description here

diff = TriangulateMesh[RegionDifference[fullRegionDifference[full, text], MeshQualityGoal -> "Minimal"] 

enter image description hereenter image description here

etext = RegionProduct[RegionBoundary[text], Line[{{0.}, {2.}}]] 

enter image description here

final = DiscretizeGraphics @ Show[ etext, RegionProduct[text, Point[{2.}]], RegionProduct[diff, Point[{0.}]], RegionProduct[full, Point[{-1.}]], RegionProduct[RegionBoundary[full], Line[{{-1.}, {0.}}]] ] 

enter image description here

The only defects here are misoriented faces (which can be fixed with RepairMesh), but this is indeed a water tight model:

FindMeshDefects[final] 

enter image description here

With a bit more work, we can take a similar approach to J.M.'s answer to build a (water tight) model with a base.

text = BoundaryDiscretizeGraphics[Text["Hello"], _Text] 

enter image description here

elongate[{a_, b_}] := With[{d = 0.05 (b - a)}, {a - d, b + d}] full = DiscretizeGraphics[Rectangle @@ Transpose[elongate /@ RegionBounds[text]]] 

enter image description here

diff = TriangulateMesh[RegionDifference[full, text], MeshQualityGoal -> "Minimal"] 

enter image description here

etext = RegionProduct[RegionBoundary[text], Line[{{0.}, {2.}}]] 

enter image description here

final = DiscretizeGraphics @ Show[ etext, RegionProduct[text, Point[{2.}]], RegionProduct[diff, Point[{0.}]], RegionProduct[full, Point[{-1.}]], RegionProduct[RegionBoundary[full], Line[{{-1.}, {0.}}]] ] 

enter image description here

The only defects here are misoriented faces (which can be fixed with RepairMesh), but this is indeed a water tight model:

FindMeshDefects[final] 

enter image description here

With a bit more work, we can take a similar approach to J.M.'s answer to build a (water tight) model with a base.

text = BoundaryDiscretizeGraphics[Text["Hello"], _Text] 

enter image description here

elongate[{a_, b_}] := With[{d = 0.05 (b - a)}, {a - d, b + d}] full = DiscretizeGraphics[Rectangle @@ Transpose[elongate /@ RegionBounds[text]]] 

enter image description here

diff = RegionDifference[full, text] 

enter image description here

etext = RegionProduct[RegionBoundary[text], Line[{{0.}, {2.}}]] 

enter image description here

final = DiscretizeGraphics @ Show[ etext, RegionProduct[text, Point[{2.}]], RegionProduct[diff, Point[{0.}]], RegionProduct[full, Point[{-1.}]], RegionProduct[RegionBoundary[full], Line[{{-1.}, {0.}}]] ] 

enter image description here

The only defects here are misoriented faces (which can be fixed with RepairMesh), but this is indeed a water tight model:

FindMeshDefects[final] 

enter image description here

deleted 432 characters in body
Source Link
Greg Hurst
  • 39.3k
  • 1
  • 101
  • 147

With a bit more work, we can take a similar approach to J.M.'s answer to build a (water tight) model with a base.

text = BoundaryDiscretizeGraphics[Text["Hello"], _Text] 

enter image description here

elongate[{a_, b_}] := With[{d = 0.05 (b - a)}, {a - d, b + d}] full = DiscretizeGraphics[Rectangle @@ Transpose[elongate /@ RegionBounds[text]]] 

enter image description here

diff = TriangulateMesh[RegionDifference[full, text], MeshQualityGoal -> "Minimal"] 

enter image description here

cc = MeshCellCount[text, 0]; ptsT = Append[#, 2.] & /@ MeshCoordinates[text]; ptsB = Append[#, 0.] & /@ MeshCoordinates[text]; extrudeetext = MeshRegion[Join[ptsT, ptsB]RegionProduct[RegionBoundary[text],  Apply[{Polygon[{Line[{#1, #2, #1 + cc}, {#1 + cc, #2 + cc, #2}}]0.} &, FindCycle[UndirectedEdge @@@ MeshCells[text, 1][[All, 1]], ∞, All], {2.}}]] 

enter image description here

base = MeshRegion[ Join[Append[#, -1.] & /@ MeshCoordinates[full], Append[#, 0.] & /@ MeshCoordinates[full]], Polygon[{{1, 2, 6, 5}, {2, 3, 7, 6}, {3, 4, 8, 7}, {4, 1, 5, 8}}]]; final = DiscretizeGraphics @ Show[ extrudeetext, RegionProduct[text, Point[{2.}]], RegionProduct[diff, Point[{0.}]], RegionProduct[full, Point[{-1.}]], baseRegionProduct[RegionBoundary[full], Line[{{-1.}, {0.}}]] ] 

enter image description here

The only defects here are misoriented faces (which can be fixed with RepairMesh), but this is indeed a water tight model:

FindMeshDefects[final] 

enter image description here

With a bit more work, we can take a similar approach to J.M.'s answer to build a (water tight) model with a base.

text = BoundaryDiscretizeGraphics[Text["Hello"], _Text] 

enter image description here

elongate[{a_, b_}] := With[{d = 0.05 (b - a)}, {a - d, b + d}] full = DiscretizeGraphics[Rectangle @@ Transpose[elongate /@ RegionBounds[text]]] 

enter image description here

diff = TriangulateMesh[RegionDifference[full, text], MeshQualityGoal -> "Minimal"] 

enter image description here

cc = MeshCellCount[text, 0]; ptsT = Append[#, 2.] & /@ MeshCoordinates[text]; ptsB = Append[#, 0.] & /@ MeshCoordinates[text]; extrude = MeshRegion[Join[ptsT, ptsB],  Apply[{Polygon[{{#1, #2, #1 + cc}, {#1 + cc, #2 + cc, #2}}]} &, FindCycle[UndirectedEdge @@@ MeshCells[text, 1][[All, 1]], ∞, All], {2}]] 

enter image description here

base = MeshRegion[ Join[Append[#, -1.] & /@ MeshCoordinates[full], Append[#, 0.] & /@ MeshCoordinates[full]], Polygon[{{1, 2, 6, 5}, {2, 3, 7, 6}, {3, 4, 8, 7}, {4, 1, 5, 8}}]]; final = DiscretizeGraphics @ Show[ extrude, RegionProduct[text, Point[{2.}]], RegionProduct[diff, Point[{0.}]], RegionProduct[full, Point[{-1.}]], base ] 

enter image description here

The only defects here are misoriented faces (which can be fixed with RepairMesh), but this is indeed a water tight model:

FindMeshDefects[final] 

enter image description here

With a bit more work, we can take a similar approach to J.M.'s answer to build a (water tight) model with a base.

text = BoundaryDiscretizeGraphics[Text["Hello"], _Text] 

enter image description here

elongate[{a_, b_}] := With[{d = 0.05 (b - a)}, {a - d, b + d}] full = DiscretizeGraphics[Rectangle @@ Transpose[elongate /@ RegionBounds[text]]] 

enter image description here

diff = TriangulateMesh[RegionDifference[full, text], MeshQualityGoal -> "Minimal"] 

enter image description here

etext = RegionProduct[RegionBoundary[text], Line[{{0.}, {2.}}]] 

enter image description here

final = DiscretizeGraphics @ Show[ etext, RegionProduct[text, Point[{2.}]], RegionProduct[diff, Point[{0.}]], RegionProduct[full, Point[{-1.}]], RegionProduct[RegionBoundary[full], Line[{{-1.}, {0.}}]] ] 

enter image description here

The only defects here are misoriented faces (which can be fixed with RepairMesh), but this is indeed a water tight model:

FindMeshDefects[final] 

enter image description here

Source Link
Greg Hurst
  • 39.3k
  • 1
  • 101
  • 147
Loading