[cgma-dev] r2494 - cgm/trunk/geom/OCC

Jiangtao Hu jiangtao_ma at yahoo.com
Tue Dec 23 14:17:39 CST 2008


Thanks Jason. I've added codes to deal with such cases.

Jane

--- On Tue, 12/23/08, Jason Kraftcheck <kraftche at cae.wisc.edu> wrote:
From: Jason Kraftcheck <kraftche at cae.wisc.edu>
Subject: Re: [cgma-dev] r2494 - cgm/trunk/geom/OCC
To: cgma-dev at mcs.anl.gov, "Developer information for cgma" <cgma-dev at lists.mcs.anl.gov>
Date: Tuesday, December 23, 2008, 2:43 PM

janehu at mcs.anl.gov wrote:
> Author: janehu
> Date: 2008-12-23 11:06:19 -0600 (Tue, 23 Dec 2008)
> New Revision: 2494
> 
> Modified:
>    cgm/trunk/geom/OCC/OCCModifyEngine.cpp
> Log:
> Updated for create_arc_three function to make sure the parameter space are
within the triangle range.
> 

Why require that?  Three coplanar, non-collinear curves that not all intersect
at the same point can define four possible circles.  Any three such lines must
form a triangle.  One possible circle seems to be the one you are considering:
the inner circle of the triangle.  The other three circles are outside the
triangle, tangent to one of the lines on the triangle boundary and tangent to
the other two lines at a point outside of the triangle.  Given that the input to
this function is a set of *bounded* curves, you should choose the circle for
which all tangent points are within the bounded region of each curve, rather
than those that are within the portion of the lines that form the triangle.

- jason




> Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
> ===================================================================
> --- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-12-22 19:17:36 UTC (rev
2493)
> +++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-12-23 17:06:19 UTC (rev
2494)
> @@ -4840,20 +4840,47 @@
>    }       //0.check that non of the curves are parallel of each other.
> -  double u11, u12, u21, u22, u31, u32;
> -  occ_crv1->get_param_range(u11, u12);
> -  occ_crv2->get_param_range(u21, u22);
> -  occ_crv3->get_param_range(u31, u32);
> -  -  CubitVector pt1, pt2, pt3;
> -  occ_crv1->position_from_u(u11, pt1);
> -  occ_crv2->position_from_u(u21, pt2);
> -  occ_crv3->position_from_u(u31, pt3);
> +  DLIList<CubitVector*> intscts;
> +  CubitVector vt1, vt2, vt3;
> +  CubitBoolean none = CUBIT_FALSE;
> +  OCCQueryEngine::instance()->get_intersections(curve1, curve2,
intscts,none,none);
> +  vt1 = *intscts.get();
> +  intscts.clean_out();
> +  OCCQueryEngine::instance()->get_intersections(curve2,curve3,
intscts,none,none);
> +  vt2 = *intscts.get();
> +  intscts.clean_out();
> +  OCCQueryEngine::instance()->get_intersections(curve3, curve1,
intscts,none,none);
> +  vt3 = *intscts.get();
>  +  double u, u11, u12, u21, u22, u31, u32;
> +  u12 = occ_crv1->u_from_position(vt1);
> +  u11 = occ_crv1->u_from_position(vt3);
> +  if(u12 < u11)
> +  {
> +    u = u12;
> +    u12 = u11;
> +    u11 = u;
> +  }
> +  u22 = occ_crv2->u_from_position(vt1);
> +  u21 = occ_crv2->u_from_position(vt2);
> +  if(u22 < u21)
> +  {
> +    u = u22;
> +    u22 = u21;
> +    u21 = u;
> +  } +  u32 = occ_crv3->u_from_position(vt2);
> +  u31 = occ_crv3->u_from_position(vt3);
> +  if(u32 < u31)
> +  {
> +    u = u32;
> +    u32 = u31;
> +    u31 = u;
> +  }
>    CubitVector tangent1, tangent2, tangent3;
> -  occ_crv1->get_tangent(pt1, tangent1);
> -  occ_crv2->get_tangent(pt2, tangent2);
> -  occ_crv3->get_tangent(pt3, tangent3); + 
occ_crv1->get_tangent(vt1, tangent1);
> +  occ_crv2->get_tangent(vt2, tangent2);
> +  occ_crv3->get_tangent(vt3, tangent3);     CubitVector normal1 =
tangent1 * tangent2;
>    CubitVector normal2 = tangent2 * tangent3;
> @@ -4889,18 +4916,6 @@
>     //2.create curves to bisection each of the angle passing through the
>    // vertices of the triangle
> -  DLIList<CubitVector*> intscts;
> -  CubitVector vt1, vt2, vt3;
> -  OCCQueryEngine::instance()->get_intersections(curve1, curve2,
intscts,0,0);
> -  vt1 = *intscts.get(); -  intscts.clean_out();
> -  OCCQueryEngine::instance()->get_intersections(curve2,curve3,
intscts,0,0);
> -  vt2 = *intscts.get();
> -  intscts.clean_out();
> -  OCCQueryEngine::instance()->get_intersections(curve3, curve1,
intscts,0,0);
> -  vt3 = *intscts.get();
> -  //Create 6 curves, find 3 of them which have intersection points inside
> -  // the third curve
>    CubitVector t_curve11 =           vectorRotate(angle1/2.0, normal1,
tangent1);     t_curve11.normalize();
> @@ -4934,10 +4949,9 @@
>    //3. find the intersection of each of the bisection curve with the
third curve
>    CubitVector int_pt1, int_pt2, int_pt3;
>    intscts.clean_out();
> -  CubitBoolean none = CUBIT_FALSE;
>    OCCQueryEngine::instance()->get_intersections(curve3, vt1, p11,
intscts,none,none);
>    CubitVector int_pt = *intscts.pop(); -  double u =
occ_crv3->u_from_position (int_pt);
> +  u = occ_crv3->u_from_position (int_pt);
>    if(u >= u31-tol && u <= u32+tol) //found intersection
point
>      int_pt1 = int_pt;
>    else
> 




      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mcs.anl.gov/mailman/private/cgma-dev/attachments/20081223/730f09d0/attachment-0001.htm>


More information about the cgma-dev mailing list