Skip to main content
added 57 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
added 222 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
  • Avoid manully Partition and construct the graph.

*

linesClear["Global`*"];
pts1 = MeshPrimitives[DiscretizeGraphics@curves{{0, 1];
data0}, ={1, Region`Mesh`SplitIntersectingSegments[lines];1}, {2, -1}, {3, 0}, {5, 2}, {6, -1}, {7, 3}};
ptspts2 = data[[1]];{{5, -2}, {0, 0}, {1, 2}, {5, 1}, {2, 2}, {4, 3}, {5, 4}};
splitspts3 = data[[2]];{{4, 2}, {3, 2}, {2, 3}, {-1, -3}};
regcurves = MeshRegion[pts{curve1, Line@splits];
graphcurve2, curve3} = MeshConnectivityGraph[reg];
Graphics[   BezierCurve /@ {HatchFilling[]pts1, pts2, pts3};
reg = BoundaryMeshRegion[pts,RegionUnion[DiscretizeGraphics /@ curves];
g = Graph[MeshPrimitives[reg, Line@Append[#1] /. Line -> Apply@UndirectedEdge, First@#] 
 &[PlanarFaceList[graph][[2]][[;;  VertexCoordinates -> MeshCoordinates[reg]];
faces = PlanarFaceList[g];
Graphics[{curves, HatchFilling[], 2]]]]EdgeForm[Cyan], 
  curvesPolygon@faces[[2]]}]

enter image description here

  • Avoid manully Partition and construct the graph.
lines = MeshPrimitives[DiscretizeGraphics@curves, 1];
data = Region`Mesh`SplitIntersectingSegments[lines];
pts = data[[1]];
splits = data[[2]];
reg = MeshRegion[pts, Line@splits];
graph = MeshConnectivityGraph[reg];
Graphics[{HatchFilling[], 
  BoundaryMeshRegion[pts, 
   Line@Append[#, First@#] &[PlanarFaceList[graph][[2]][[;; , 2]]]], 
  curves}]

*

Clear["Global`*"];
pts1 = {{0, 0}, {1, 1}, {2, -1}, {3, 0}, {5, 2}, {6, -1}, {7, 3}};
pts2 = {{5, -2}, {0, 0}, {1, 2}, {5, 1}, {2, 2}, {4, 3}, {5, 4}};
pts3 = {{4, 2}, {3, 2}, {2, 3}, {-1, -3}};
curves = {curve1, curve2, curve3} = 
   BezierCurve /@ {pts1, pts2, pts3};
reg = RegionUnion[DiscretizeGraphics /@ curves];
g = Graph[MeshPrimitives[reg, 1] /. Line -> Apply@UndirectedEdge,  
   VertexCoordinates -> MeshCoordinates[reg]];
faces = PlanarFaceList[g];
Graphics[{curves, HatchFilling[], EdgeForm[Cyan], 
  Polygon@faces[[2]]}]

enter image description here

added 200 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
  • Avoid manully Partition and construct the graph.
lines = MeshPrimitives[DiscretizeGraphics@curves, 1];
data = Region`Mesh`SplitIntersectingSegments[lines];
pts = data[[1]];
splits = data[[2]];
reg = MeshRegion[pts, Line@segments];Line@splits];
graph = MeshConnectivityGraph[reg];
Graphics[{HatchFilling[], 
  BoundaryMeshRegion[pts, 
   Line@Append[#, First@#] &[PlanarFaceList[graph][[2]][[;; , 2]]]], 
  curves}]
reg = MeshRegion[pts, Line@segments];
graph = MeshConnectivityGraph[reg];
Graphics[{HatchFilling[], 
  BoundaryMeshRegion[pts, 
   Line@Append[#, First@#] &[PlanarFaceList[graph][[2]][[;; , 2]]]], 
  curves}]
  • Avoid manully Partition and construct the graph.
lines = MeshPrimitives[DiscretizeGraphics@curves, 1];
data = Region`Mesh`SplitIntersectingSegments[lines];
pts = data[[1]];
splits = data[[2]];
reg = MeshRegion[pts, Line@splits];
graph = MeshConnectivityGraph[reg];
Graphics[{HatchFilling[], 
  BoundaryMeshRegion[pts, 
   Line@Append[#, First@#] &[PlanarFaceList[graph][[2]][[;; , 2]]]], 
  curves}]
added 225 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
deleted 19 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
added 2 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
added 1087 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
typo
Source Link
AsukaMinato
  • 10.4k
  • 1
  • 17
  • 44
Loading
deleted 103 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
deleted 103 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
added 9 characters in body
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading
Source Link
cvgmt
  • 84.1k
  • 6
  • 97
  • 179
Loading