Mathematica Asked by Dunlop on August 16, 2021
I have a polygon object that I wish to discretize.
e.g.
points0 = {{0, 0}, {1, 2}, {1, 0}, {0, 0}}
DiscretizeRegion[Line[points0]]
My goal is to increase the number of points between the edges using internal Mathematica functions. I have tried using Polygon, BoundaryDiscretize reigion and other functions but can’t seem to get just the edge meshed. Any help would be greatly appreciated.
You can specify the maximum cell measures using the option MaxCellMeasure
:
DiscretizeRegion[Line[points0], MaxCellMeasure -> {"Length" -> .1}] (* or *)
DiscretizeRegion[Line[points0], MaxCellMeasure -> {1 -> .1}]
Use MaxCellMeasure -> {"Length" -> .5}
to get
Correct answer by kglr on August 16, 2021
Given points0 we want to insert points so that the original interval between two point is split into n intervals:
n = 2;
points0 = {{0, 0}, {1, 2}, {1, 0}, {0, 0}};
tmp = Table[#[[1]] + i (#[[2]] - #[[1]])/n, {i, 0, n - 1}] & /@
Partition[points0, 2, 1]
newpts=Append[Flatten[tmp, 1], points0[[-1]]]
Answered by Daniel Huber on August 16, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP