Add Vertex function bug
显示 更早的评论
There seems to be a problem with the addvertex function in R2022a. It works fine in R2021a.
There is a problem in how I can add new vertices to an existing model, where this is some inconsistency in passing 2D and 3D vertices to the addVertex function.
Sometimes, it seems there is a problem on how the function wants 2D inputs and sometimes 3D inputs.
Here's a sample. How can it take the first vertex and not the second one?
pgon = polyshape([1 1 2 4], [1 4 4 1]);
tr = triangulation(pgon);
pdmodel = createpde;
g = geometryFromMesh(pdmodel, tr.Points', tr.ConnectivityList');
addVertex(g,'Coordinates',double([1.66,4.00; 1.33,4.00])); % This works
addVertex(g,'Coordinates',double([1.00,3.00; 1.00,2.00])); % This throws an error
5 个评论
Kangming Xu 10/181
2022-7-20
Thank you for reaching out to us.
I successfully reproduced the issue in MATLAB R2022a and reported the issue to our development team. Please let me know if you have any questions in the meantime!
Allan
2022-7-21
A possible workaround from me is to add each vertex one by one. Please let me know whether it works for you or not. For example,
pgon = polyshape([1 1 2 4], [1 4 4 1]);
tr = triangulation(pgon);
pdmodel = createpde;
g = geometryFromMesh(pdmodel, tr.Points', tr.ConnectivityList');
addVertex(g,'Coordinates',[1.66,4.00]);
addVertex(g,'Coordinates',[1.33,4.00]);
addVertex(g,'Coordinates', [1.00,3.00]);
addVertex(g,'Coordinates',[1.00,2.00]);
pdegplot(g, 'VertexLabels', 'on','FaceAlpha',0.5);
xl z
2024-6-11
How to add points on a cylindrical surface? It will prompt an error-“Specified point too far from the boundaries.”
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Structural Mechanics 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
