I am trying to insert a list of values into a 3D array, not substituting them, but inserting them between
@blocks[$i8][$it] and
@blocks[$i8][$it + 1]. This will increase the total # of vertex by one, shifting all of the vertex after
@blocks[$i8][$it]. Can someone please help me with this, thanks.
Here is some of the code I am trying to use. I have a 3D array @blocks. It looks like this
$blocks[$i][$j][$k]. $i is a list of blocks. $j is a list of vertex that make up the block. and $k is 0-6 where 0= # of the point 1= x-value of the point 2= y-value of the point and 3 through 6 are other values of the point. What I am trying to do is insert all of the information of a point, thus creating a new one and shifting the list of vertex by 1.
# $it2 is where I want to put the new vertex info "@t"
# I want to put the new info in between @blocks[$i8][$it]
# and @blocks[$i8][$it + 1]
# $i8 is the block that I want to insert the new vertex
# information into
# $datapoint[$kk][1] is the new x-value
# $datapoint[$kk][2] is the new y-value
my @t = (
11111,
$datapoint[$kk][1],
$datapoint[$kk][2],
0,
0,
99999,
11111,
);
splice (@{blocks[$i8]}, ($it2 + 1), 0, \@t);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.