Shapes3d: Box Object: missing command setSize

Dear all,

sorry, when this has been asked before.

Please jump to my Edit parts below.

  • Box Object:

In an OLD shapes3d lib by @quark :

Box Object: missing command setSize().

// OLD Help for setSize(float width, float height, float depth) boxBoard[iBox].setsize(80, 5, 80);

also Box Object: command draw() needs to be : myBox.draw( getGraphics() );

  • Also

also this func gives a problem. It’s a new code for replacing the even older code for Toroid of the same lib :

classes Path and Oval not existing

Tube makeToroid(float ringX, float ringY,
int nbrSlices,
float crossX, float crossY,
int nbrSegs) {

// Create tube path (circular / elliptical)
Path path = new Ring(ringX, ringY, nbrSlices);

// Create torroid cross-section
Oval oval = new Oval(crossX, crossY, nbrSegs);

//  Extrude oval round path to create torroid
Tube toroid = new Tube(path, oval);

return toroid;
}
  • Also

this gives an error

Shape3D picked = Shape3D.pickShapeB(this, mouseX, mouseY);

func doesn’t exist

Edit

Apprently the imports need to be in an certain order for some of the issues above :

import shapes3d.*;
import shapes3d.contour.*;
import shapes3d.org.apache.commons.math.*;
import shapes3d.org.apache.commons.math.geometry.*;
import shapes3d.path.*;
import shapes3d.utils.*;

Edited II :

ok, this is what I got now

    // by Quark: http://www.lagers.org.uk/s3d4p/index.html
    Picked picked = Shape3D.pick ( this, getGraphics(), mouseX, mouseY );

    if (picked != null) {
      done = true;
      MakeHumanMove ( picked.part );
    }

But he doesn’t get the right picked.part !!!

Before part I had tagNo

in combination with an init routine saying

boxBoard[iBox].tagNo = iBox;

I wanted to say

boxBoard[iBox].part = iBox; // part was tagNo before

but it’s not allowed

How can I fix these issues?

Thank you all !

Warm regards,

Chrisir

Hi @Chrisir good to know someone is still using Shapes3D as it was first released 17 years ago and the latest version V3.0 was 6 years ago. It has been so long since I used it I thought I better try it out in Processing 4.5.6 and I am pleased to say all the library examples worked just fine: :smiley:

Which version are we talking about? Version 3 was a complete redesign / rewrite of the library which will make it difficult to convert sketches using V2

There is no such method called pickShapeB in the library hence the error message.

The import order should not make a difference but the order you report is the one used by Processing when adding the library to a sketch.

As regard to the torroid code I assume you it is the same code I posted in this discussion

I just copied the code into 4.5.6 and it worked fine for me.

If you are having problems with picking then check out the library examples and if they work for you it must be something in your code.

Let me know how you get on. :grinning_face:

setSize is not a method in V3 must have been in an earlier version.

Regards
quark