JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. drewpear
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 0
    • Controversial 0
    • Groups 0

    Drew Pear

    @drewpear

    I enjoy web hosting and development, creating manuals, tutorials, and helpful pages. i build marimbas out of stained glass and provide tools and tutorials for their construction online. This has brought me here to for help and to learn. Though, not to become well-versed in jscad. i haven't the brain left or the time. However, i find it interesting and challenging as other types of code does and it allows me to provide web pages where visitors can determine the size of a hollow sphere to resonate a given frequency and then 3d print them. Refining these pages is why i am here. Thank you.

    0
    Reputation
    156
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Website glass-marimba.ml Location Cedar, mi Age 67

    drewpear Unfollow Follow

    Latest posts made by drewpear

    • RE: Online versus offline functionality

      @z3dev
      thanks for the reply!

      my phone is running android 10 and chrome v. 87
      i created an android app using jscad. the editor, model,
      and parameter box will not show up because it isn't being served
      and there is no way to render the default model. once rendering starts,
      the editor and parameter box appears also.
      if i download jscad and open it up on my computer,
      i've always had to press f5 before the default model renders.
      this is true with all browsers.
      i am able to change the key that has to be pressed.
      i thought this is important because i think a function key
      is hard to emulate. i've been trying to figure out how to
      emulate a keypress with a button's onclick property.
      then i could just have a button labeled start and that would solve the issue
      with running it on android. i've played around with a couple online examples,
      but i haven't gotten there yet. besides a button, i think clicking anywhere on the page can be used to emulate a keypress also. that would work.

      why it auto renders when accessed from a server is curious.

      posted in General Discussions
      drewpear
      drewpear
    • RE: Online versus offline functionality

      howdy,
      sorry for the delay...life.
      i've tried all browsers.
      i'm trying to use it as an app in android.
      there isn't f5 or shift/return capability.
      i found reference to f5 in the javascript, but it's for windows or mac.
      i wonder why it doesn't load automatically if it is not being served up.

      posted in General Discussions
      drewpear
      drewpear
    • RE: Openscad to JSCAD Refinement

      @gilboonet
      thank you for that.
      after a few mis-steps and with the guidance of editor prompts, i came up with this which seems to work for the sphere with a sound hole.
      i'm tickled pink because i had wanted to provide form fields for the parameters also, but due to my newbieness, thought it would be additional html/javascripting.


      function
      main(params) {

       var sr = params.sphereradius;
       var sh = params.soundhole;
       var wt = params.wallthickness;
       var fn = params.fragmentnumber;
        
       return [	  
          difference(sphere({r:sr+wt, center:true, fn:fn}),
          sphere({r:sr, center:true, fn:fn}),
          cylinder ({r:sh, h:-(sr+wt)}))
      ]; 
      

      }

      function getParameterDefinitions() {
      return [
      { name: 'sphereradius', type: 'number', initial: 47, caption: 'Sphere Radius' },
      { name: 'soundhole', type: 'number', initial: 15, caption: 'Sound Hole Radius' },
      { name: 'wallthickness', type: 'number', initial: 2, caption: 'Wall Thickness' },
      { name: 'fragmentnumber', type: 'number', initial: 100, caption: 'Fragment Number' },
      ];
      }

      posted in Development Discussions
      drewpear
      drewpear
    • Openscad to JSCAD Refinement

      howdy all,

      i host a few pages where folks can determine the diameter of sphere to resonate a given frequency and then 3d print them if they wish using openjscad. i originally wrote some code with openscad before i was aware of openjscad. i have been able to port the code over from openscad, however there is some functionality i haven't been able convert from openscad. as shown below, with the openscad code i was able to provide an area where visitors are able to enter the variables and then the remainder of the code processes those variables. with jscad, i have been unable to provide the same functionality and therefor visitors must edit throughout the code directly with whatever instructions i can provide to make it not too confusing. there are two sphere types. one has a sound hole and the other has a tube elongating the sound hole. below is what i have done for each type.

      Sphere with a sound hole -

      OPENSCAD:

      // Example A 440Hz

      // fragment number

      $fn=100;

      // Enter sphere diameter

      sd=143.38;

      // Enter wall thickness

      wt=2;

      // Enter sound hole diameter.

      sh=25;

      difference() {
      sphere(d=sd+(2wt));
      sphere(d=sd);
      translate([0,0,-sd/2-wt])cylinder(d=sh,h=wt
      2);
      }

      JSCAD:

      // Example A 440Hz

      // BEGINNING OF CODE

      function
      main() {
      return [

      // Enter radius of sphere plus 2 for r:
      difference(sphere({r: 47, center:true, fn: 100}),

      // Enter radius of sphere for r:
      sphere({r: 45, center:true, fn: 100}),

      // Enter radius of sound hole for r: and h= -radius of first sphere
      cylinder({r: 12.5, h: -47})),

      ];
      }

      // END OF CODE

      Sphere with tube -

      OPENSCAD:

      // Example: A 220Hz

      // fragment number

      $fn=100;

      // Enter sphere diameter.

      sd=132.47;

      // Enter Sound Hole Diameter.

      sh=25;

      // Enter length of neck

      ln=25;

      // Enter wall Thickness

      wt=2;

      // SPHERE

      difference() {
      sphere(d=sd+(2wt));
      sphere(d=sd);
      translate([0,0,-(sd/2)-wt])cylinder(d=sh,h=wt
      2);
      }

      // NECK

      difference() {
      translate([0,0,-ln-(sd/2)+wt])cylinder(d=sh+(2*wt),h=ln);
      translate([0,0,-ln-(sd/2)+wt])cylinder(d=sh,h=ln);
      }

      JSCAD:

      // Example: A 440Hz

      // BEGINNING OF CODE

      function
      main() {
      return [

      // Sphere1. Enter radius of sphere +2 for r:

      difference(sphere({r: 35, center:true, fn: 100}),

      // Sphere2. Enter radius of sphere for r:

      sphere({r: 33, center:true, fn: 100}),

      // Enter radius of sound hole for r: and radius of sphere1 for h:

      cylinder({r: 12.5, h: -35, fn: 100})),

      // Enter radius of sound hole +2 for r:
      // Enter length of neck for h:
      // Enter radius of sphere2 plus height of neck
      // minus 2x wall thickness(2x2=4 in this example) for .translate

      difference(cylinder({r: 14.5, h: 25, fn: 100}).translate([0,0,-54]),

      // Enter radius of sound hole for r:
      // Enter length of neck for h:
      // Enter radius of sphere2 plus height of neck
      // minus 2x wall thickness(2x2=4 in this example) for .translate

      cylinder({r: 12.5, h: 25, fn: 100}).translate([0,0,-54])),

      ];
      }

      // END OF CODE

      i would love for visitors to be able to simply define the variables of sphere radius or diameter, sound hole diameter, tube length, wall thickness, and fragment number and then let the code do the rest.

      thank you for any insights you can offer.

      posted in Development Discussions
      drewpear
      drewpear