Inconsistent plotting behavior of polyshapes between R2017b and R2018a

3 visualizaciones (últimos 30 días)
I am running the code below to plot polyshapes using nsidedpoly in MATLAB R2018a, but I get different behavior when running the program as a whole and executing it section wise.
My reproduction code is as follows:
%%part 1:
figure
pgon = nsidedpoly(6,'radius',1/2);
plot(pgon)
hold on, grid on, axis equal
%%part 2:
ps = pgon.translate(0,1*sqrt(3)/2);
plot(ps)
My findings are:
  1. Selecting and executing all lines at one time by pressing F9 results in the correct coloring
  2. Selecting and evaluating the two parts one after another results in wrong coloring (the second polyshape is transparent, the second color is overlaying the first polyshape).

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 5 de Sept. de 2018
Editada: MathWorks Support Team el 5 de Sept. de 2018
This unexpected behavior occurs due to a bug within the triangulation method of polyshape in MATLAB R2018a. This problem has been fixed in MATLAB R2018b and is also not present in MATLAB R2017b or before.

Más respuestas (0)

Categorías

Más información sobre Elementary Polygons en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by