I had posted a formula some time ago that allowed using the
Equation Driven Curve Sketch Tool for generating a conic that could
be controlled using the rho value. I'm not looking to rehash the
value of having conics in SW but I am looking for any feedback
about how I am using the tool and if anyone else is seeing the
disparities that I am seeing. Here's my problem: I want to generate
my conic surfaces using a formula but there seems to be a small
(but to me significant) difference in the results depending on how
I generate the curve.

To get to the point, I tried to confirm the formulas by creating a surface using a rho of 0 and then comparing the areas of the surface with the area of a like surface created using an arc and using a spline with fixed points (the Optis lens creation tool).

The formula's I used were:

y=(x^2/R)/(1+(1-(1+b)/(x/R)^2)^1/2)

and

y=(b^2*(x/R)^2-x2)^1/2)

where x = the start and end points, R = the radius and b = the conic constant (Rho). For my "test" I used a radius of 8.4mm, a diameter of 8.8mm (x 0, 4.4) and a Rho value of 0.

The calculated areas are:

65.68751533mm2 for the SW arc;

65.68479891mm2 for the Optis spline;

65.68423769mm2 for the first formula;

65.68423769mm2 for the second formula.

Like I said, not much difference but to me significant since Optis uses the surfaces to do the calculations for raytrace. When I contacted Optis about the differences they were able to confirm that the lens creation tool does create a surface that results in correct optical data when compared to Zemax (which does the calculations mathematically and displays the rays for reference only). Also something to consider in judging the difference as significant is that the curve is only a 4.4mm radius. We do design large hyperbolic reflectors once in a while so the disparity will only get worse. For now I have the Optis interface to use but I would like to better understand why the methods don't match up. Any ideas?

To get to the point, I tried to confirm the formulas by creating a surface using a rho of 0 and then comparing the areas of the surface with the area of a like surface created using an arc and using a spline with fixed points (the Optis lens creation tool).

The formula's I used were:

y=(x^2/R)/(1+(1-(1+b)/(x/R)^2)^1/2)

and

y=(b^2*(x/R)^2-x2)^1/2)

where x = the start and end points, R = the radius and b = the conic constant (Rho). For my "test" I used a radius of 8.4mm, a diameter of 8.8mm (x 0, 4.4) and a Rho value of 0.

The calculated areas are:

65.68751533mm2 for the SW arc;

65.68479891mm2 for the Optis spline;

65.68423769mm2 for the first formula;

65.68423769mm2 for the second formula.

Like I said, not much difference but to me significant since Optis uses the surfaces to do the calculations for raytrace. When I contacted Optis about the differences they were able to confirm that the lens creation tool does create a surface that results in correct optical data when compared to Zemax (which does the calculations mathematically and displays the rays for reference only). Also something to consider in judging the difference as significant is that the curve is only a 4.4mm radius. We do design large hyperbolic reflectors once in a while so the disparity will only get worse. For now I have the Optis interface to use but I would like to better understand why the methods don't match up. Any ideas?

I just had a though. If you already have Optis why don't you use raytracing as your measurement method instead of lens area? Just place a sensor or output the raytrace to a measurable 3dSketch. I could be wrong, but my gut tells me that an error of .0008-.0050% in the lens surface area will probably not have a measurable impact. By using the raytracing you're matching the measurement tool to the lens' actual performance instead of an arbitrary area. For all you know the curve differences are limited to the outer .01 percent of the lens aperture that nobody uses anyhow. Hopefully, the final result would be that the equation driven curve is close enough to keep using it. I've worked with a fair amount of lenses, and I know what an annoyance it is having to redo a lens from scratch because an optical engineer decided to change the asphere coefficient from 1.214 to 1.215.

I have prefered using solids over surfaces for my models for creating prints and assembly files so in the past I would create the asperic surface in Optis and delete the surface leaving the sketch to create the solid. That made the sketch uneditable. The lens creation tool in optis does allow the sketch to be edited if the surface is not deleted so I can always extrude up to the surface if I want a solid.

I had subitted a suggestion to Optis to use the Equation Driven Sketch function now that SW supports that feature instead of the spline. When the issue was investigated there it was found that the results were unreliable. I just did a little trial using a few different options available in Optis and most give the same results as a simple arc with the exception of the aspheric which is only slightly different. The largest error seems to be generated using the SW tool.

I intend to send something to my VAR soon.

y=(R^2 - x^2)^1/2

Yep, it's a circle formula. For a cap with a radius of 10mm and a diameter of 10mm, the area's for the original posted formula and the above formula are 84.17430771mm^2 but for a cap generated using an arc the area is 84.17872143mm^2.

I read a short discussion at Matt's Blog http://www.dezignstuff.com/blog/?p=937 regarding the use of conics and the rate at which they are being addressed at SW. Perhaps it is because the formula driven sketch function performance that conics are not a feature. Is everybody else having reasonable success with this new tool or isn't it being used? I do know that you need to be picky about entering the formula and such or there will be errors.

For polynomials, the equation curve should be exact. For any other type of equation, like your circle example, the curve should be accurate to within 0.001mm, irrespective of the size of the curve.

That means in the worst case scenario that your circle is really of radius 10.001mm, then the area of the full circle would be out by pi(10.001^2 - 10^2) = 0.063mm^2.

Regards,

Andy.

Thanks for looking at my question.

.063mm^2 seems huge to me but my results also differ from yours in that they are not a maximum offset that does not increase with size. For my "test" I used a radius of 10 to 80mm in 10mm increments and a diameter of 10mm (x1=0, x2=5). The calculated areas for the simple circle formula above compared to the arc are:

R sw radius sw formula error

10 84.17872145 84.17430767 0.00441378

20 79.80691729 79.80336514 0.00355215

30 79.09294107 79.08953575 0.00340532

40 78.84903301 78.84573716 0.00329585

50 78.73715381 78.73382833 0.00332548

60 78.67664570 78.67332931 0.00331639

70 78.64025105 78.63694012 0.00331093

80 78.61666555 78.61335815 0.00330740

For a 50mm diameter, 80mm radius cap, the error is .08257146mm^2. If I use a plano surface (disc) offset by 10mm, apply optical properties (SF11) to the part and measure the focal length at 532nm the difference is 2.76mm. That's a lot. I get comparable results using the conic formula to the point that I cannot use the formula driven sketch for optical surfaces. As I've said before : 1. It could be my error, 2. I'm glad I'm not designing something large like an airfoil.

The key for me is that the error translates into errors in the optical calculations because the curve is wrong. The area is simply the easiest way to measure the error for someone without OptisWorks (or another ray trace program). We could just as well use volume if I revolved the part as a solid. I would assume the error would be just as unacceptable to someone designing large or high-volume production plastic parts that needs to know exactly how much plastic will be used over time; or for an air foil such as a wing or for cooling vents; or for a microwave antennae, etc.

I've attached the part file that has been sent to SW with the SR. If any Math-a-magicians have a chance to look at the formula's, that'd be great. I don't mind being wrong (even in a public forum) nor am I trying to be a jerk about it, I just want to have this resolved so that I can use the tool with confidence.

## Attachments

I received a response to the SR generated by my VAR:

"The equation curves in SolidWorks have +/- 1e-6 as the accuracy limit, and the customer's application appears to require the curves that are more accurate than this. With this curve 'error', if he creates the surfaces then the difference may look big.

For the accurate representation, customer needs conics in sketcher and unfortunately it is not available in SolidWorks as of now. An enhancement request, SPR # 219494, is already reported and I will add your case to it. You will be informed once this functionality gets implemented."

I looked and the SPR priority is rated "low". A portion of my response (yes, I can be very verbose):

I have to say that I am very frustrated with the "solution". Set aside the secondary question of whether or not SW should have conic curve sketch functionality and consider the results of a surface created from any simple formula. My example being the arc/circle part I submitted.

I generated a spreadsheet with the three different formulas for generating an arc, two using a conic. I calculated 25 points along the curve and compared that result to the spline created by the Optis Lens tool. The errors are 0 e-7 mm for all for an arc of 80mm radius out to 25mm from the origin (a 50mm diameter cap). I then used the arc sketch tool to check the curves. Again 0 e-7. I know the formulas are correct. I compared the area for the surface created by the Optis spline and the SW arc sketch. The same to e-8 mm.

So if the curve in Optis creates the same area as the SW arc sketch, and the formulas that I have entered in the equation driven curve sketch tool are accurate to e-7 mm, why is the area different? For a cap of diameter 500mm with a radius of 600mm the error is 8.6mm2. Perhaps the problem isn't the sketch but instead is in the generation of the surface. Lumping the issue in with the request for a conic curve function doesn't seem to address the problem or to provide a thorough answer.

I'll continue to pursue this through my VAR but unless anyone has some input I'm letting it drop here.

I just came across your forum and noticed last comment was posted in April.

I am fairly new to SW with some exposure to ProE.

I am doing some work in comparing accuracy of surfaces modeled in ProE and SW.

I need to model optical surfaces driven by equation and started with a circle defined by equ. and revolved it.

Analyzing surface found a significant amount of ripple. Sagital values for a 9.0mm radius 16.0mm diameter oscillate up and down from theoretical values by @+/-0.003mm but in local curvature by as much as 0.5mm.

For some the +/-0.003mm may not mean much but for optics guys this is huge.

Attached is a file with just a sketch containing one curve by equ. (right side) and same size radius using the sketcher. It is a JPG file because I could not attach the SW file but is easy to construct looking at annotations.

If you do a curvature analysis you will see what I am talking about.

SPR 506532 was opened today to address this issue. I found it very similar to your kind of problem.

I hope Andy Fraser (Manager - Sketcher Development - SolidWorks Corporation) sees this because it contradicts his statement from an earlier reply in which he claims that curvature is within 0.001mm from a 10.0mm target.

Cornelius Niculas

Cibavision Co.

## Attachments

My VAR and SW Corporate have continued working with me to better understand my issue. I suspect the software engineer(s) at SW look at my emails and files and say "Yes, SW is doing exactly as it should. What is the problem?" They can't fix something that they do not perceive to be broken. I have a lot of empathy for them in that regard. At least they haven't given up!

There seems to be a little bit of a communication gap regarding what I believe the equation driven sketch tool (and for that matter, the spline tool) should provide in accuracy and what I can verify with the tools available. The latest email exchange has been this week. My understanding is that SW will not provide an exact calculation for a bspline generated surface (which the equation driven sketch is) and will only return an approximation of "reasonable accuracy" for surface, volume, etc. I'm not exactly sure what "reasonable" is nor do I understand how OptisWorks is able to return calculated results comparable to ZEMAX (which is purely math based) using spline surfaces... just not equation driven sketch surfaces! I also do not understand how other users get by with an approximation when designing conic surfaces (I keep using the example of an airfoil). Wrong is wrong, or is it? Is it right but it measures wrong? I don't know but I need confidence before I re-impliment the tool.

I keep hoping there is a solution and that the equation driven sketch tool will work properly. Better yet of course would be to compliment it with a true conic sketch tool (You may say I'm a dreamer).

By the way, welcome to the forum!

Hi Harold,

Yes, the differences you noticed were indeed down to the measure tool, and not the accuracy of the equation curve.

For analytical surfaces, for example a cylinder, the measure tool uses simple maths to calculate areas quickly and accurately. For other surfaces, the measure tool approximates the area. There is always a trade-off between accuracy and time. Generally, numerical techniques get more accurate if they run for longer.

I know this doesn't solve your problem, but I hope it helps explain what is going on.

Regards,

Andy.

Hi Cornelius,

The curve you provided only deviates by a few tens of nanometres from a pure circle; this is within the tolerance of the tool. Only deviation accuracy and not curvature accuracy is built into the tool. This means that even though the equation curve is very similar to a circle, it may oscillate around a true circle to a maximum deviation of 0.001mm. This causes the curvature defects you are seeing.

The equation curve tool is exact for polynomials, so for example, for parabolas written in the form a + bx + cx^2.

Have you tried 2010 beta? The accuracy has not been changed, so this does not address your problem, but the curves are now easier to position. Parametric and 3D curves are also supported, as is using dimensions in the equation definition.

Out of interest, to what accuracy are your optical surfaces manufactured?

Regards,

Andy.

Andy,

We grind hyperbolic shapes into 4 sides of a tungston mandrel over 12" to 18" in length by about .75" square. We grind to +/- 1 to 2 millionths of an inch accuracy for the hyperbolas over the entire length of the mandrel. We are usually closer to 1 millionth or less of accuracy than 2 millionths after they are checked on our CMM.

Cheers,

Hi Andy:

I did not see 3D curve in SW2010 Beta, only parametric curve is there.

Andy,

The surfaces we generate in our optical models are toleranced as +/- 1.3nM for a typical lens and as large as +/-13.8nM for a hyperbolic reflector.

All the optical add-in softwares in the SW partner product listing (and several major design packages like OSLO and ZEMAX) will translate surfaces generated in SW for use in analysis. Other than Optis, all require exporting the surfaces so perhaps you can understand why the surfaces need to be accurate. Optis provides a very good user interface for generating optical surfaces but as with all the other add-in softwares the point is being able to generate parts in SW and apply optical properties to those parts.

As for using polynomials, most aspheric surfaces in optics are specified using the radius of curvature and the conic value. Having one formula that allows me to change the surface from an ellipse to a parabola to a hyperbola by manipulating one variable is really convenient as well.

If the limiting factor is the that a higher resolution bspline surface will slow the system down, perhaps the option for a slider similar to the graphics quality could be added. I don't need the accuracy in all my models either if it is going to make my system a dog but when I do need it I really need it.

I work on optical designs as well and an equation-driven curve, however accurate or inaccurate, is a problem for me, because I want a "free" conic that can move and change shape as a function of other sketch elements.

For example, in complex 3D optical systems it is often easiest to get a lot of "hand" calculations done before throwing it at an optimizer. Especially when you have to interface with a 3D object, Solidworks is a great way to layout the optical path first before going into optical design. To do this, I sketch out reflections and refractions. Solidworks is limited in this since I can only do this (without extensive construction tricks) by drawing lines tangent to my surface, which, as far as conics go, is only available on the circle and the ellipse.

Let's say I have an elliptical reflector. I can sketch in the reflectors, then constrain the input and output rays accordingly, and let the ellipse change as necessary. This requires some finessing because the sketch will occasionally "jam". Once I have the ellipse, I can take a few dimensions and stick it in an optical design program and proceed to do accurate ray tracing. This is sometimes the only way to get the optimizer to end up in the right place.

So an equation driven curve is not a viable solution, because in my case the coefficients themselves are variables. Thus the need for a hyperbola and parabola tool that behaves like the ellipse and circle (able to add tangent relations). Ideally you'd be able to add a "normal to curve" relation, since that elliminates some of the extra construction lines I have to put in.

In an effort to do something about it, I've created enhancement requests. I don't know the history of the problem, and I was surprised to find no enhancement requests for anything relating to conics. So here you go:

The hyperbola request is ER# 1-1413855312

The tangents to conics request is ER# 1-1414911712

For me the equation driven curve sketch is not the solution but the closest thing to having a conic tool in SW. I rarely need to use the sketch tools as construction tools for the optical system. I have used the ellipse sketch tool and construction lines as a start point for simple reflectors but I have the OptisWorks Add-in for Optical Design (as well as the lighting Add-in) so I don't need to sketch in SW and optimize elsewhere. I can do it all within the SW assembly model but the surfaces need to be accurate however they are created. Optis has an interactive source tool that keeps the trace simple: no optical calculations like focal length, etc and it is in the plane the sketch is created. It is very fast and easy to use.

I am not saying what you are asking for is not necessary. I think the more tools available the better. You might find that conic creation and the tools that other programs have are not as much of a requirement for the general SW user (this is my opinion anyway) and the support you want may not be as overwhelming as you might hope.

Harold