Sphere Cylinder Intersection

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sphere Cylinder Intersection


    Working OFFLINE from HOME.

    I need to find an intersection of an internal cylinder and an internal sphere. Need to find the height at which the cylinder contacts the sphere. Tried to construct a circle from the intersection of the cylinder and sphere but PC DMIS doesn't support that. Decided my best option was to create a generic point using an intersection formula I googled. Square root of (sphere_radius squared - cylinder radius squared) Tried turning that into an assignment as follows:


    Code:
    DIM D3= LOCATION OF SPHERE SPH1 UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    X 0.000 0.050 0.050 0.000 0.000 0.000 ----#----
    Y 0.000 0.050 0.050 0.000 0.000 0.000 ----#----
    Z 0.000 0.050 0.050 0.000 0.000 0.000 ----#----
    D 5.207 0.050 0.050 5.207 0.000 0.000 ----#----
    R 2.603 0.025 0.025 2.603 0.000 0.000 ----#----
    END OF DIMENSION D3
    
    DIM D4= LOCATION OF CYLINDER CYL1 UNITS=MM ,$
    GRAPH=OFF TEXT=OFF MULT=10.00 OUTPUT=BOTH HALF ANGLE=NO
    AX NOMINAL +TOL -TOL MEAS DEV OUTTOL
    X 0.000 0.050 0.050 0.000 0.000 0.000 ----#----
    Y 0.000 0.050 0.050 0.000 0.000 0.000 ----#----
    Z -4.830 0.050 0.050 -4.830 0.000 0.000 ----#----
    D 2.381 0.050 0.050 2.381 0.000 0.000 ----#----
    R 1.190 0.025 0.025 1.191 0.000 0.000 ----#----
    END OF DIMENSION D4
    
    ASSIGN/SPH_RAD_SQD=D3.R.MEAS*D3.R.MEAS
    
    ASSIGN/CYL_RAD_SQD=D4.R.MEAS*D4.R.MEAS
    
    ASSIGN/V1=SQR(SPH_RAD_SQD-CYL_RAD_SQD)
    
    F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
    NOM/XYZ,<0,0,0>,$
    MEAS/XYZ,<0,0,V1>,$
    NOM/IJK,<0,0,1>,$
    MEAS/IJK,<0,0,1>
    My issue is that V1's value is Zero. I suspect that working offline is not doing assignments properly. Is there a work around to get the assignments updated or another way to find the height at which a cylinder contacts a sphere? Or did I just not code the formula in correctly?







  • #2
    Maybe D3.R
    D4.R
    without the .meas

    B&S CHAMELEON/PCDMIS CAD++ V2011

    There are no bugs, only "UNDOCUMENTED ENHANCEMENTS!"

    sigpic

    Comment


    • #3
      I would use directly SPH1.R and CYL1.R...
      In addition, it's "SQRT" and not "SQR"...
      So V1 is zero because of an unknown function...

      ASSIGN/V1=SQRT((SPH1.R)^2-(CYL1.R)^2)

      Comment


      • #4
        Got this to work. Variable didn't want to process the assignment.

        F1 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
        NOM/XYZ,<0,0,-2.284>,$
        MEAS/XYZ,<0,0,(SQRT(SPH1.R^2-CYL1.R^2)*-1)>,$
        NOM/IJK,<0,0,1>,$
        MEAS/IJK,<0,0,1>

        Comment

        Related Topics

        Collapse

        Working...
        X