Ellipse Created with ECMA

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
wildspidee
Full Member
Posts: 84
Joined: Sat Nov 03, 2012 2:00 am

Ellipse Created with ECMA

Post by wildspidee » Thu Mar 05, 2015 4:26 pm

Andrew,

I would like to draw an ellipse based on diameter with code. I located the REllipse in the documentation.

Code: Select all

REllipse::REllipse	(	const RVector & 	center,
const RVector & 	majorPoint,
double 	ratio,
double 	startParam,
double 	endParam,
bool 	reversed 
)	
I don't know what these parameters are in reference to. The only one I understand is Center. As I did with the Fit to Points Spline, perhaps I can create an empty REllipse and then call some other function of yours to create one using X, Y, Angle and Center based on diameter?

Could you explain these parameters to me so that I can set them properly?

Thank you,
Lori

User avatar
andrew
Site Admin
Posts: 9052
Joined: Fri Mar 30, 2007 6:07 am

Re: Ellipse Created with ECMA

Post by andrew » Thu Mar 05, 2015 4:39 pm

center is the center point of the ellipse.
majorPoint is an end point of the major axis (the longer of the two ellipse axis), relative to the ellipse center.
ratio is the ratio between minor and major axis (second to first axis), e.g. 0.5 for a minor axis that is half as long as the major axis or 1.0 for a circle.
startParam defines the start angle (not strictly an angle for an ellipse, hence called parameter).
endParam defines the end angle.
reversed true for cw, false for ccw.

wildspidee
Full Member
Posts: 84
Joined: Sat Nov 03, 2012 2:00 am

Re: Ellipse Created with ECMA

Post by wildspidee » Thu Mar 05, 2015 5:40 pm

Thank you Andrew.

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”