Browse Search Popular Register Upload Rules User list Login:
Search:
Yeah, sure, whatever.;)
Last edited at 2024/10/11 09:51:49 by s_noonan
Thanks.
I'm impressed by your tight coding. I aspire to create coding as tight as yours.
Make sure Options|Autosave and Options|'Automatically check for updates' are unchecked. Click slower. I can reliably click 20 times in 20 seconds on my 11 year old PC. You can change "_c > 11" to "_c > 5" in the checkbox update method. "_c > 11" is a compromise between responsiveness and lag for any GUI in any scene. I'm not ready to start tuning it for each GUI in each scene, but I will do it for this scene since there are only (8) instances of "_c > 11".
Thanks for the feedback.
Nice work.:tup:
Nice additions. I don't see any instructions on how to move the raytrace camera. I don't see a method to rotate the raytrace camera.
Good explanation. Well done.:tup:
Xray--Thanks. Got it.
Good idea. Thanks.
Q: How does the laser cut the object?
A: The laser converts the object to a polygon if needed, sets the polygon angle to zero without rotating the part, and puts recursive splitting code in the onDie method of the new polygon. When the polygon dies it generates _numOfSlices new polygons. That happens recursively for _numOfGens. Code is in the big laser onLaserHit method.
_functions defined within _applyForce are creating a memory leak. Fixing the memory leak should reduce the lag.

The memory leak can be seen by using the Task Manager.

The memory leak can be fixed by adding:
  divide = "";
  abs = "";
  rotate = "";
  xfor = "";
to the end of the _applyForce function.
Last edited at 2024/10/23 00:40:22 by s_noonan
AverageCoder,

Please be more considerate next time and test your scene after posting it.
Well done.:tup:
Last edited at 2024/10/25 11:57:28 by s_noonan
Yes, working well now.:tup:
Some polygon scenes for reference:
Poly2CSV CSV2Poly copies a polygon surface to a CSV file and vice versa
Polygon Smoothing smooth polygon
Polygon Roughing roughen polygon
Polygon Modifier insert vertex, delete vertex, drag vertex, smoothing
Shrink Ray grow or shrink polygon
Mirror Polygon mirror polygon
Milling Cutter cut into polygon upon collision
Rotate Polygon rotate polygon in 3D
Transform Polygon scale x, scale y, rotate, shear x, shear y polygon
Modify Polygon Surface Polygon Modifier with GUI
Sutherland-Hodgman polygon clipping clip polygon
Laser Fragmenter cut polygon into multiple pieces
Last edited at 2024/11/01 10:05:20 by s_noonan
Well done. I suggest you copy the texture and texture matrix to the new polygon and set the laser maxRays=1.

Some polygon scenes for reference
Thanks for the comments. I fixed the code for boxes.
Well, since you mentioned accuracy, here are my thoughts:
  1. Friction between the side guides and the plate will affect the measurement.
  2. The person's head leaning against the side plate will affect the measurement.
  3. Buoyancy will affect the measurement.
  4. sim.frequency will affect the measurement (higher frequencies are typically more
   accurate).
  5. The side plates are not necessary.
  6. Weight is measured in Newtons.
  7. Mass is measured in kilograms.
  8. If you select the whole body, right click, then select information, then the total mass will
   be displayed.
  9. A more accurate value may be obtained by averaging many values.

Suggested formulas:
  Scene.my.mass = _Self.totImp3(1) * sim.frequency / Sim.gravityStrength - massOfPlate
  Scene.my.weight = _Self.totImp3(1) * sim.frequency - massOfPlate * Sim.gravityStrength

Here's some smoothing code:
  _massOfPlate := 2.0;
  _smoothedReading = 1.32;
  _TC = 2.0;  
      
  postStep = (e)=>{
    v := _Self.totImp3(1) * sim.frequency / Sim.gravityStrength - _massOfPlate;
    _smoothedReading = _smoothedReading + (v - _smoothedReading) / (sim.frequency * _TC);
    Scene.my.mass = _smoothedReading
  }

Display box code:
  text = math.toInt(Scene.my.mass * 1000000) * 1e-006 + " kilograms"

Results:
  The value that I get at sim.frequency = 300 Hz is 1.32746 kg which is within 0.03% of Algodoo's value of 1.327.
Last edited at 2024/11/08 11:37:59 by s_noonan
Nice work:tup:
Well done. Nice effects. Perfect. I see that you were very debonair when you were younger.:tup:
Well done. Unbreakable (but brake-able) pleasing design. I made it past the dump to the invisible wall with only a few helping hands.:tup:
Good.
Last edited at 2024/11/20 01:33:56 by s_noonan
Thanks. I read up on UARTs before making this scene. This concept will allow other programs to do stuff Algodoo can't do, similar to what I did with AlgoSound.
Thanks for the quick and detailed response.:tup:
Xray,

Thanks for trying. You don't need to know much about Python. You just need to be able to run the script. Python_IPC_01.py should be in the C:\Users\XRay\Documents\Algodoo folder. It should be 8 KB. If it's 16 KB, then you tried loading it twice (since Algodoo only appends files and does not overwrite them). If the file is too big, just delete it and run the Agodoo scene again. Double-click Python_IPC_01.py and it just might work. That's how it works on my PC (although "Open with > Python" doesn't work). If double-clicking Python_IPC_01.py and "Open with > Python" doesn't work, then open IDLE, which is installed with Python. Find IDLE bt typing "IDLE" in the lower left corner of your desktop if using Windows.

Open IDLE. Do IDLE File>Open...Python_IPC_01.py, a new window opens displaying Python_IPC_01.py code, do Run>Run Module and a Python GUI that looks similar to the "Algodoo IPC A" GUI should show. If for any reason the script fails, IDLE will tell you why it failed. Communicate after Python_IPC_01.py and this Algodoo scene are both running.
Very well done. It's like going to the drive-in movies.:tup:

HingeBendConstant is the hinge torsional stiffness in N-m/radian.
HingeBendTarget is the angle where hinge torque is zero.
HingeBendConstant and HingeBendTarget are analogous to spring constant and target length for linear springs.
Good work.:tup: I rated highly in order to try and get you into the highlighted scene group.
Nice scene. Works well. I played with it for a while. I tried adding very small attraction to the moon pieces, no improvement. I made a new moon and split it into 625 pieces (5 slices, 4 gens) by using the Laser Breaker, but there was no noticeable improvement over your original scene.
Q: Would it be okay ...?
A: Sure, no problem.

BTW I was going to script the springs in Algodoo until I found out you can't script springs in Algodoo. So now I output the poly surfaces to surfaces.txt using Algodoo, then I have a Python script that reads surfaces.txt and outputs mesh.phn to the "phunlets" folder. I can then load the phunlet directly or use scene.importPhunlet. All the parts are working OK, now I just need to add the IPC UART code to make the whole process automatic so that I can hit an object with a laser and the object gets replaced with the spring meshed model.
previous | 1 … 113 114 115 116 117 … 120 | next