Editing User:Gaganjyotsingh/Proposal/LibreCADkickoff
From BRL-CAD
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 49: | Line 49: | ||
For the Line, the move can be implemented as | For the Line, the move can be implemented as | ||
− | |||
void move_line ( coordinate offset ) { | void move_line ( coordinate offset ) { | ||
− | |||
start_point = start_point + offset; | start_point = start_point + offset; | ||
− | |||
end_point = end_point + offset; | end_point = end_point + offset; | ||
− | |||
} | } | ||
delete_line(id); // Immutable approach, older gets deleted and a new will be created. | delete_line(id); // Immutable approach, older gets deleted and a new will be created. | ||
− | |||
new_line(start_point, end_point); // values changed above. | new_line(start_point, end_point); // values changed above. | ||
− | |||
For Circle and Arc, the center will be moved by the offset value | For Circle and Arc, the center will be moved by the offset value | ||
Line 86: | Line 80: | ||
void rotate ( double angle ) { | void rotate ( double angle ) { | ||
− | |||
// Rotation around itself at some angle. | // Rotation around itself at some angle. | ||
− | + | // first the double value will be converted into a coordinate using sin cos functions for x and y coordinate respectively | |
− | // first the double value will be converted into a coordinate using sin cos | ||
− | functions for x and y coordinate respectively | ||
and then the algo will be applied to rotate the entity. Which is like | and then the algo will be applied to rotate the entity. Which is like | ||
− | |||
temp_x = x * angle.x – y * angle.y // stored in temp since we need older x value | temp_x = x * angle.x – y * angle.y // stored in temp since we need older x value | ||
− | |||
y = x * angle.y – y * angle.x | y = x * angle.y – y * angle.x | ||
− | |||
x = temp | x = temp | ||
− | |||
} | } | ||
Line 109: | Line 96: | ||
*Text will have support for the following attributes, | *Text will have support for the following attributes, | ||
− | + | Insertion point : The point at wich entity is to be inserted. | |
− | + | SecondPoint : It is used by the aligned fit. | |
− | + | Widthrel : It is the width of reference rectangle around the text. | |
− | + | Height : Height of text | |
− | + | Valign : Vertical Alignment of the Dimension value text | |
− | + | Halign : Horizontal Alignment of the dimension value text | |
− | + | Text : Text value held by dimension entity | |
− | + | Style : Style of the text | |
− | + | Angle : If the text is aligned at some angle | |
*Dimension has the following attributes, | *Dimension has the following attributes, | ||
− | + | DefinitionPoint : The point at which dimension is defined | |
− | + | MiddleOfText : Middle of the dimension text | |
− | + | Valign : Vertical Alignment of the Dimension value text | |
− | + | Halign : Horizontal Alignment of the dimension value text | |
− | + | LineSpacingStyle : Spacing style if any for the dimension | |
− | + | LineSpacingFactor : Spacing factor if any | |
− | + | Text : Text value held by dimension entity | |
− | + | Style : Style of the text | |
− | + | Angle : If the text is aligned at some angle | |
====Intersection Stuff==== | ====Intersection Stuff==== | ||
+ | // YET TO BE ADDED AND IS THE MAIN MATHS PART | ||
− | + | ====References :==== | |
− | + | Circle circle intersection | |
− | + | http://mathworld.wolfram.com/Circle-CircleIntersection.html | |
− | + | http://stackoverflow.com/questions/3349125/circle-circle-intersection-points | |
− | + | Ellipse Line : | |
− | + | http://www.nabla.hr/Z_MemoHU-029.htm | |
− | + | http://gieseanw.wordpress.com/2013/07/19/an-analytic-solution-for-ellipse-and-line-intersection/ | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | // | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | http:// | ||
− | |||
− | |||
− | |||
− | |||
− | |||
===Deliverables:=== | ===Deliverables:=== | ||
− | The project can be divided in at least | + | The project can be divided in at least 5 parts, so all of this can be considered a specific measurable goal (one for every feature implemented). LibreCAD v3 Kernel will be delivered with the support of following, |
#Operations: | #Operations: |