필터 지우기
필터 지우기

Add Vertex function bug

조회 수: 2 (최근 30일)
Allan
Allan 2022년 7월 18일
댓글: xl z 2024년 6월 11일
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
Error using pde.DiscreteGeometry/addVertex
Coordinates value must be a 3-column double matrix not containing Inf, NaN, or complex numbers.
  댓글 수: 5
Allan
Allan 2022년 7월 22일
편집: Allan 2022년 7월 22일
Yes that works! My full code is working now.
Thank you for your suggestion @Kangming
xl z
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.”

댓글을 달려면 로그인하십시오.

채택된 답변

Allan
Allan 2022년 7월 25일
@Kangming had give a workaround to this bug. Adding a vertex one by one seems to not have pose any issues with the addVertex( ) function.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by