Signup Issues have been resolved (hopefully). If you have previously had issues signing up for the forum, please try again.
0 Members and 1 Guest are viewing this topic.
//############################################################################LaserBoy_Bounds chil(LaserBoy_frame_set* p_frame_set){ bool is_lit = false; int i, j; LaserBoy_3D_double Z_offset(0.0, 0.0, 100.0); LaserBoy_vertex previous_vertex; LaserBoy_frame frame(p_frame_set->p_space); LaserBoy_frame_set in(*p_frame_set), out(p_frame_set->p_space); //-------------------------------------------------------------------- for(i = 0; i < (int)in.number_of_frames(); i++) { frame.clear(); if(in[i].size() > 1) { if(in[i].is_2D()) in[i].move(Z_offset, false); in[i].best_match_palette(LASERBOY_ILDA_STANDARD); //LASERBOY_ILDA_STANDARD frame.push_back(in[i][0]); frame.push_back(in[i][0]); previous_vertex = in[i][0]; for(j = 1; j < (int)in[i].size(); j++) { if( (!is_lit) && in[i][j].is_lit() ) { frame += in[i][j]; is_lit = true; } else if( (is_lit) && in[i][j].is_blank() ) { frame += in[i][j]; is_lit = false; } else if( (is_lit) && in[i][j].is_lit() && ( ((LaserBoy_color)in[i][j]) != ((LaserBoy_color)previous_vertex) ) ) { frame += in[i][j]; } frame += in[i][j]; if (in[i][j].is_blank()) { // set off blanking & add in[i][j].unblank(); frame += in[i][j]; in[i][j].blank(); } previous_vertex = in[i][j]; } frame += in[i].back(); } out += frame; } //-------------------------------------------------------------------- out.save_as_ild(LASERBOY_ILD_SHARE + "chil.ild"); return LASERBOY_IN_BOUNDS;}//############################################################################
if (in[i][j].is_blank()) { // set off blanking & add in[i][j].unblank(); frame += in[i][j]; in[i][j].blank(); }
if (in[i][j].is_blank()) { // set off blanking & add frame += in[i][j]; frame.back().unblank(); }
python ilda_edit.py (optional path to V0-V3 Ild file)
//############################################################################LaserBoy_Bounds chil(LaserBoy_frame_set* p_frame_set){ int i, j; LaserBoy_3D_double Z_offset(0.0, 0.0, 100.0); // to make 2D into 3D LaserBoy_frame frame(p_frame_set->p_space); // a temp container to build a frame out of individual vertices LaserBoy_frame_set in(*p_frame_set), // a copy of the currently loaded frame set out(p_frame_set->p_space); // a container for the resulting modified frame set //-------------------------------------------------------------------- for(i = 0; i < (int)in.number_of_frames(); i++) // i is the index of each frame in the set { frame.clear(); // empty the temp frame container if(in[i].size() > 1) // if this frame has vertices { if(in[i].is_2D()) in[i].move(Z_offset, false); // convert 2D to 3D in[i].best_match_palette(LASERBOY_ILDA_DEFAULT); // convert to Default palette frame.push_back(in[i][0]); // add the original vertex of this frame to the temp frame frame.push_back(in[i][0]); // add another copy of the original vertex to the temp frame // The zeroth vertex of a frame is only an anchor point for the first vector. // It has no color and it is neither lit or blank, but it has a coordinate location. // A properly implemented ILDA reader would not read color or blanking information from this vertex. // But, it should be saved as blank in the file. for(j = 1; j < (int)in[i].size(); j++) // j is every vertex in this frame after the zeroth { frame += in[i][j]; // no matter what, add this vertex to the frame // if this vertex is lit and the previous one is not if( (!in[i][j - 1].is_lit()) // look at the previous vertex && in[i][j].is_lit() ) frame += in[i][j]; // add this vertex to the frame (again) //------------------------------------------------------------- // if this vertex is blank and the previous one is not else if( in[i][j - 1].is_lit() // look at the previous vertex && in[i][j].is_blank() ) frame += in[i][j]; // add this vertex to the frame (again) //------------------------------------------------------------- // if this vertex is lit and not the same color as the previous lit vertex else if( in[i][j - 1].is_lit() && in[i][j].is_lit() && ( ((LaserBoy_color)in[i][j]) != ((LaserBoy_color)in[i][j - 1]) // look at the previous vertex ) ) frame += in[i][j]; // add this vertex to the frame (again) } // end for(j = 1; j < (int)in[i].size(); j++) //----------------------------------------------------------------- frame += in[i].back(); // add the last vertex to the frame (again) } // end if(in[i].size() > 1) //--------------------------------------------------------------------- out += frame; // add this frame to the new resulting frame set } // end for(i = 0; i < (int)in.number_of_frames(); i++) //-------------------------------------------------------------------- out.save_as_ild(LASERBOY_ILD_SHARE + "chil.ild"); // save the frame set return LASERBOY_IN_BOUNDS; // there is no way this new frame set could be out of bounds.}//############################################################################