[Ca...] Posted January 29, 2021 Share Posted January 29, 2021 Hello (again), I have a for me not so easy task. Explaination: I exctracted a Sphere out of a model and with this Dimensions i start with several calculations to define 3 heights on this Sphere. Problem: My problem is more less, a sphere has no start and end point, lika a cone for example. Currently i used a value where i say the Sphere has a approx value of 10mm (f.e.) and place on this 10mm , 3 different heights. But i would really like to define it a bit more percise like 1mm from start or 1mm from end. (which is not defined in a sphere). I will add some pictures below. 🙂 This Picture Shows the "extracted sphere - Sphere1" (its according base alignment - later calculations are to an other alignment). The SPHERE_AT_CRL_2 is the Circle in the middle. (the others i didnt show to dont overload the picture.. 🙂) Below the Code which i used to come to that point (no im not a math professor, so dont be bad with me.. 😜) SPHERE_LENGTH = 10.0 // APPROX SPHERE LENGTH! (ONLY NEEDED IF SPHERE_SHAPE = 1) SPHERE_SHAPE = 1 // SPHERE SHAPE MEASURMENT (0 = OFF / 1 = ON) This is for the Sphere length calcuation as i dont have a start and end point.. CRL_24_LENGTH = Y Value @ SPHERE_AT_CRL_2 CRL_24_DIA = Dia @ SPHERE_AT_CRL_2 ANGLE_24 = Angle @ SPHERE_AT_CRL_2 CRL_24_LENGTH = (getNominal("Sphere1").y + LENGTH)-(SPHERE_LENGTH/10*4)*(-1) R2_24 = squared(getNominal("Sphere1").diameter/2) LNGT_24 = squared(getNominal("Sphere1").y + LENGTH - CRL_24_LENGTH) ALPHA_24 = sqrt(R2_24-LNGT_24) CRL_24_DIA =ALPHA_24*2 ANGLE_24_LNGT = getNominal("Sphere1").y + LENGTH - CRL_24_LENGTH ANGLE_24_RAD = radArcsin(ANGLE_24_LNGT/(getNominal("Sphere1").diameter/2)) ANGLE_24 = rad(180/3.141592654*ANGLE_24_RAD)*2*(-1) So i guess i will stop here.. so in the end, the question is more or less if somebody has an idea how to get a Start and End Point on the Sphere to use it for the Calculation. Thanks in advance for your support. 🙂 Regards Link to comment Share on other sites More sharing options...
[Er...] Posted January 29, 2021 Share Posted January 29, 2021 I think your problem comes from your initial approach. "Lenght". Use the spehere radius and the origin. So if you wish to get the Ø at a given offset from the sphere center: a=sqrt(r**2-o**2) Where r is the spehere radius and o is the offset from sphere origo. Ø at offset from center=a*2 So if you measure your sphere as a sphere, you can calculate the diameter a given heights. (If the form error is low.) If you need to go further I recomment threating the sphere as a unit circle (of 1). Anf then just scale your unit vector to appropriate lenght. (Easier to do "professor" stuff that way.) If I understand your question correctly. Which I don't think I do.. 😕 Link to comment Share on other sites More sharing options...
[Ca...] Posted January 29, 2021 Author Share Posted January 29, 2021 Thank you Eric, i will review your approch beginning of next week 🙂 So the Origin is in this case the "X0, Y-30.8020, Z0" and the Radius is the Diameter / 2 (radius 😜). The Sphere it self will never get measured, we check only several Diameters on the Sphere. So in the end your calculation would look like. End Point is according Model at 64.2814 @ DIA 6.9668 Start Point is according Model at 57.5665 @ DIA 17.3899 a = (sqrt(getNominal("Sphere1").diameter/2) - (getNominal("Sphere1").y/2) - LENGTH) *(-1) = 68.6322 I guess i did your calculation wrong hehe. Perhaphs you can hook my up a little. 🙂 Thanks in advance for your support, i really appriciate. Link to comment Share on other sites More sharing options...
[Er...] Posted February 1, 2021 Share Posted February 1, 2021 I still don't understand what you are trying to do. But here is some "clarification". a=sqrt(getActual("sphere").radius**2-Offset**2) sphereDiaAtOffset=a*2 //-Coordinates relative to sphere center coordinate1=getActual("sphere").radius-a coordinate2=Offset Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in