Difference between revisions of "User:GregoryLi/GSoC2023/DevLog"

From BRL-CAD
 
(35 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
=Deliverables=
 +
 +
Now I have committed 3 pull requests for the **Brep Editing Support in BRL-CAD** project. The final report, which summarizes the features and provides a vision for the future, is also attached at the following link.
 +
 +
[https://github.com/BRL-CAD/brlcad/pull/80 Nurbs editing Milestone 1: Curve operations]
 +
 +
[https://github.com/BRL-CAD/brlcad/pull/92 Nurbs editing Milestone 2: Surface operations]
 +
 +
[https://github.com/BRL-CAD/brlcad/pull/97 Nurbs editing Milestone 3: topology operations]
 +
 +
[https://brlcad.org/wiki/User:GregoryLi/GSoC2023/FinalReport Final Report for NURBS Editing]
 +
 
=Development Logs=
 
=Development Logs=
  
Line 12: Line 24:
 
==Monday, May 29th, 2023==
 
==Monday, May 29th, 2023==
  
* Add '''brep <objname> create_curve <x> <y> <z>''' to create a template NURBS curve.
+
* Add ''brep <objname> create_curve <x> <y> <z>'' to create a template NURBS curve.
 +
* Add ''brep [options] <objname> move_curve_CV <curve_id> <CV_id> <x> <y> <z> <w>"'' to move control vertex of a NURBS curve.
 +
 
 +
==Tuesday, May 30th, 2023==
 +
 
 +
* Add the entry and judgment for the number of parameters of ''brep [options] <objname> in_curve <is_rational> <order> <CV_count> <cv1_x> <cv1_y> <cv1_z> <cv_w>(if rational) ...'' Use ''in_curve'' for create NURBS curve with detailed info.
 +
* Learn the code of ''in'' command, hope users could input parameters step by step like ''in'' command.
 +
 
 +
==Wednesday, May 31th, 2023==
 +
 
 +
* Use uniform knot vector for ''in_curve''. Now the created curve by ''in'' is valid.
 +
* add ''brep [name] curve'' entry. Add libged/brep/curve.cpp.
 +
* Optimize feedback of wrong parameter number of ''in_curve'' cmd.
 +
 
 +
==Thursday, June 1st, 2023==
 +
 
 +
* Have a short meeting with Daniel. The brep/NURBS editing operations shall be implemented in ''libbrep'' instead of ''librt''. Refer to ''nmg_mm()'' function and ''ON_boolean()''.
 +
 
 +
==Saturday, June 3rd, 2023==
 +
 
 +
* Add ''brep_create_empty_brep()'' in ''libbrep'' and use it in ''make'' command.
 +
* Remove ''rt_brep_create_brep()'' in librt.
 +
 
 +
==Monday, June 5th, 2023==
 +
 
 +
* Create ON_Brep instead of rt_brep_interval in libbrep.
 +
* Fix errors codes and file headers.
 +
* Track brep subcommands to see parameter passing and call stacks.
 +
 
 +
==Tuesday, June 6th, 2023==
 +
 
 +
* Solve function declarations in ''libbrep/edit.h''. ''brep_create()'' shall be accessed by c files. ''brep_make_curve()'' shall be accessed by cpp files and compiled as C++. Because it uses openNURBS.
 +
* Reorganize ''brep [name] curve make [other infos]'' and ''brep [name] curve in [other infos]'' to ''libbrep''.
 +
 
 +
==Wednesday, June 7th, 2023==
 +
 
 +
* Move ''curve move_cv'' function to libbrep.
 +
* Add ''curve flip'' function.
 +
* Reconsider about data structure from libged to libbrep. Use more specific ''ON_Brep'' and other entities instead of ''argc'' and ''argv''.
 +
 
 +
==Monday, June 12th, 2023==
 +
* Add ''curve insert_knot'' function.
 +
* Add ''curve trim'' function.
 +
* Add surface subcommand of brep.
 +
* Add ''surface create'' command to create a nurbs surface.
 +
 
 +
==Tuesday, June 13th, 2023==
 +
* Add ''curve move'' function.
 +
* Add ''surface move'' function.
 +
* Add ''surface move_cv'' function.
 +
* Add ''surface trim'' function.
 +
 
 +
==Wednesday, June 14th, 2023==
 +
* Refactor args passed to libged/edit. All args like (ON_brep* , ...)
 +
* Look ''Ayma'' about functions to be added. (https://ayam.sourceforge.net/docs/ayam-5.html)
 +
 
 +
==Thursday, June 15th, 2023==
 +
* Add cmd ``brep .. surface create_from_curves ..``. Like lofting in Rhino.
 +
 
 +
==Friday, June 16th, 2023==
 +
* Investigate how to implement curve interpolation given a list of points.
 +
* Look Ayam about NURBS curves & surface editing supports.
 +
Ayam only contains geometry editing support, no topology operations involved.
 +
 
 +
==Monday, June 19th, 2023==
 +
* Learn about curve/surface operations in Rhino.
 +
Add three TO-DOs of milestone 1:
 +
 
 +
1. close curve (make an open curve closed. the two end point shall be overlap)
 +
 
 +
2. join (given two curves, attach them end to end, get one curve with C0 at connection. The two end shall have same Cartesian coordinates. If not, use move control vertex first)
 +
 
 +
3. detach (split one curve into two given parameter value)
 +
 
 +
==Tuesday, June 20th, 2023==
 +
* Add ``brep .. curve join ..`` cmd.
 +
Join the end of curve_id_1 to the start of curve_id_2. Delete the two old curves. '''The index of C3 is changed'''. If the two curve ends is not matched, match them.
 +
 
 +
==Wensday, June 21th, 2023==
 +
* Read ''The NURBS Book'' about spline curve interpolation.
 +
 
 +
==Thursday, June 22th, 2023==
 +
* Implement tangent vector caculate of spline curve local interpolation.
 +
 
 +
==Saturday, June 24th, 2023==
 +
* Optimize function names and create pull request of milestone 1.
 +
 
 +
==Sunday, June 25th, 2023==
 +
* Write two shell test scripts about curve & surface operations.
 +
* Read HACKING about coding style.
 +
 
 +
==Monday, June 26th, 2023==
 +
* Check coding style according to HACKING.
 +
 
 +
==Wensday, June 28th, 2023==
 +
* Implement local cubic spline curve interpolation.
 +
* Understanding and converting order and knot vector among ''The NURBS book'', ''OpenNURBS'' and ''SISL''.
 +
 
 +
==Thursday, June 29th, 2023==
 +
* Implement local cubic spline curve interpolation in BRL-CAD.
 +
 
 +
==Saturday, July 1st, 2023==
 +
* Try to implement local cubic spline curve with variable number of points and last point coordinates.
 +
* Fix errors in PR.
 +
 
 +
==Monday, July 3rd, 2023==
 +
* Add ''curve remove'' function.
 +
* Add ''surface remove'' function.
 +
* Add ''curve split'' function.
 +
* Add ''surface split'' function.
 +
 
 +
==Tuesday, July 4th, 2023==
 +
* Want to implement curve interporation like Rhino. Reconsider about data Structures and functions.
 +
* Read ''typein'' about asking more arguments. ''GED_MORE'' is not supported in ''brep'' cmd yet.
 +
 
 +
==Saturday, July 8th, 2023==
 +
* Learn about ''surface interporation'' in ''The NURBS book''.
 +
 
 +
==Sunday, July 9th, 2023==
 +
* Learn about tensor product surface, as well as implemention in OpenNURBS.
 +
* Add ''brep .. surface tensor ..'' function.
 +
 
 +
==Monday, July 11th-18th, 2023==
 +
* One week away for meeting.
 +
* Update wiki about NURBS editing operations.
 +
 
 +
==Friday, July 21th, 2023==
 +
* Add ''surface revolution''function to create a NURBS surface by rotating a curve around an axis by an angle.
 +
 
 +
==Saturday, July 22th, 2023==
 +
* Learn about ''surface interporation'' in ''The NURBS book''.
 +
 
 +
==Tuesday, July 25th, 2023==
 +
* Learn about the relationship between curve/surface continuity and knot multiplicity.
 +
* Learn about knot vector of cubic curve, check previous curve interpolation functions.
 +
 
 +
==Wensday, July 26th, 2023==
 +
* Implement u/v knot vector caculation of surface interpolation.
 +
 
 +
==Friday, July 28th, 2023==
 +
* Caculate du/dv of each given vertices.
 +
* Read math formula about Duv, edge span. They are really confusing.
 +
 
 +
==Saturday, July 29th, 2023==
 +
* Read math formula about global curve interpolation. It can achieve C2 continuity between knots.
 +
* Read math formula about global surface interpolation.
 +
 
 +
==Sunday, July 30th, 2023==
 +
* Implement global cubic curve interpolation.
 +
* Read math formula about global surface interpolation.
 +
 
 +
==Monday, July 31th, 2023==
 +
* Caculate knot vector while interpolating bicubic surface.
 +
* Implement some functions of global surface interpolation.
 +
 
 +
==Tuesday, Augest 1st, 2023==
 +
* Implement global surface interpolation with C2 continuity.
 +
* fix get_nurbs_surf.
 +
 
 +
==Wensday, Augest 2nd, 2023==
 +
* Write two shell script to test new features of milestone 2.
 +
* submit PR of milestone 2.
 +
 
 +
==Thursday, Augest 3rd, 2023==
 +
* Check code format according to HACKING.
 +
 
 +
==Monday, Augest 7th, 2023==
 +
* Run and check source codes of Ayma about NURBS operations.
 +
 
 +
==Thursday, Auguest 10th, 2023==
 +
* Check code logic about running "kill" after NURBS operations.
 +
* Configuring the environment on a new computer.
 +
 
 +
==Friday, Auguest 11th, 2023==
 +
* fix bugs, remove "kill" after NURBS operations. Do some tests.
 +
* fix bugs, fix memory management.
 +
 
 +
==Sunday, Auguest 13th, 2023==
 +
* Check topology cmds to be implemented and examples.
 +
* Add topology editing module.
 +
* Add create vertex cmd. (is a geometric operation, but is temporarily in the topology subcommand)
 +
 
 +
==Monday, Auguest 14th, 2023==
 +
* Fix error in curve id judgement.
 +
* Add create topology edge cmd.
 +
 
 +
==Tuesday, Auguest 16th, 2023==
 +
* Read codes about creating loops.
 +
* Write test code about triangular prism
 +
 
 +
==Wensday, Auguest 17th, 2023==
 +
* Create topo faces
 +
* Implement 'create loop' function
 +
* Write test code about triangular prism
 +
 
 +
==Thursday, Auguest 18th, 2023==
 +
* Add 'brep .. surface extract_curve ..' function
 +
* Add 'brep .. surface ext_v ..' function
 +
* Add 'brep .. topo create_l ..' function
 +
* Some code refactor
 +
 
 +
==Saturday, Auguest 20th, 2023==
 +
* Try to understand operations in parameter space.
 +
* Add 'brep .. curve make_2dline ..' cmd.
 +
 
 +
==Sunday, Auguest 21th, 2023==
 +
* Add 'brep .. topo create_l ..' function
 +
* Add 'brep .. topo create_t ..' function
 +
* Write test code about cube with a piece cut out
 +
 
 +
==Monday, Auguest 22th, 2023==
 +
* Reclassify nurbs editing operations into geometric and topological operations
 +
* Create 'brep .. geo' subcmd
 +
* Move 'create_v' cmd to geo subcmd
 +
* Write test code about cube with a piece cut out
 +
 
 +
==Tuesday, Auguest 23th, 2023==
 +
* Move all geometry commands to 'brep .. geo ..'
 +
* Move all topology commands to 'brep .. topo ..'
 +
* Add remove functions for curve2d,vertex
 +
* Some code refactor
 +
* Write test code about cube with a piece cut out

Latest revision as of 21:39, 1 September 2023

Contents

Deliverables[edit]

Now I have committed 3 pull requests for the **Brep Editing Support in BRL-CAD** project. The final report, which summarizes the features and provides a vision for the future, is also attached at the following link.

Nurbs editing Milestone 1: Curve operations

Nurbs editing Milestone 2: Surface operations

Nurbs editing Milestone 3: topology operations

Final Report for NURBS Editing

Development Logs[edit]

Community Bonding Period

  • Learn about brep_cube brep_simple brep_surface examples in proc-db.
  • Learn about NURBS editing support of Ayam and Blender.
  • Create a brep object with a single NURBS curve in proc-db.
  • Add create [name] brep command to create an empty brep object.

Work Period

Monday, May 29th, 2023[edit]

  • Add brep <objname> create_curve <x> <y> <z> to create a template NURBS curve.
  • Add brep [options] <objname> move_curve_CV <curve_id> <CV_id> <x> <y> <z> <w>" to move control vertex of a NURBS curve.

Tuesday, May 30th, 2023[edit]

  • Add the entry and judgment for the number of parameters of brep [options] <objname> in_curve <is_rational> <order> <CV_count> <cv1_x> <cv1_y> <cv1_z> <cv_w>(if rational) ... Use in_curve for create NURBS curve with detailed info.
  • Learn the code of in command, hope users could input parameters step by step like in command.

Wednesday, May 31th, 2023[edit]

  • Use uniform knot vector for in_curve. Now the created curve by in is valid.
  • add brep [name] curve entry. Add libged/brep/curve.cpp.
  • Optimize feedback of wrong parameter number of in_curve cmd.

Thursday, June 1st, 2023[edit]

  • Have a short meeting with Daniel. The brep/NURBS editing operations shall be implemented in libbrep instead of librt. Refer to nmg_mm() function and ON_boolean().

Saturday, June 3rd, 2023[edit]

  • Add brep_create_empty_brep() in libbrep and use it in make command.
  • Remove rt_brep_create_brep() in librt.

Monday, June 5th, 2023[edit]

  • Create ON_Brep instead of rt_brep_interval in libbrep.
  • Fix errors codes and file headers.
  • Track brep subcommands to see parameter passing and call stacks.

Tuesday, June 6th, 2023[edit]

  • Solve function declarations in libbrep/edit.h. brep_create() shall be accessed by c files. brep_make_curve() shall be accessed by cpp files and compiled as C++. Because it uses openNURBS.
  • Reorganize brep [name] curve make [other infos] and brep [name] curve in [other infos] to libbrep.

Wednesday, June 7th, 2023[edit]

  • Move curve move_cv function to libbrep.
  • Add curve flip function.
  • Reconsider about data structure from libged to libbrep. Use more specific ON_Brep and other entities instead of argc and argv.

Monday, June 12th, 2023[edit]

  • Add curve insert_knot function.
  • Add curve trim function.
  • Add surface subcommand of brep.
  • Add surface create command to create a nurbs surface.

Tuesday, June 13th, 2023[edit]

  • Add curve move function.
  • Add surface move function.
  • Add surface move_cv function.
  • Add surface trim function.

Wednesday, June 14th, 2023[edit]

Thursday, June 15th, 2023[edit]

  • Add cmd ``brep .. surface create_from_curves ..``. Like lofting in Rhino.

Friday, June 16th, 2023[edit]

  • Investigate how to implement curve interpolation given a list of points.
  • Look Ayam about NURBS curves & surface editing supports.

Ayam only contains geometry editing support, no topology operations involved.

Monday, June 19th, 2023[edit]

  • Learn about curve/surface operations in Rhino.

Add three TO-DOs of milestone 1:

1. close curve (make an open curve closed. the two end point shall be overlap)

2. join (given two curves, attach them end to end, get one curve with C0 at connection. The two end shall have same Cartesian coordinates. If not, use move control vertex first)

3. detach (split one curve into two given parameter value)

Tuesday, June 20th, 2023[edit]

  • Add ``brep .. curve join ..`` cmd.

Join the end of curve_id_1 to the start of curve_id_2. Delete the two old curves. The index of C3 is changed. If the two curve ends is not matched, match them.

Wensday, June 21th, 2023[edit]

  • Read The NURBS Book about spline curve interpolation.

Thursday, June 22th, 2023[edit]

  • Implement tangent vector caculate of spline curve local interpolation.

Saturday, June 24th, 2023[edit]

  • Optimize function names and create pull request of milestone 1.

Sunday, June 25th, 2023[edit]

  • Write two shell test scripts about curve & surface operations.
  • Read HACKING about coding style.

Monday, June 26th, 2023[edit]

  • Check coding style according to HACKING.

Wensday, June 28th, 2023[edit]

  • Implement local cubic spline curve interpolation.
  • Understanding and converting order and knot vector among The NURBS book, OpenNURBS and SISL.

Thursday, June 29th, 2023[edit]

  • Implement local cubic spline curve interpolation in BRL-CAD.

Saturday, July 1st, 2023[edit]

  • Try to implement local cubic spline curve with variable number of points and last point coordinates.
  • Fix errors in PR.

Monday, July 3rd, 2023[edit]

  • Add curve remove function.
  • Add surface remove function.
  • Add curve split function.
  • Add surface split function.

Tuesday, July 4th, 2023[edit]

  • Want to implement curve interporation like Rhino. Reconsider about data Structures and functions.
  • Read typein about asking more arguments. GED_MORE is not supported in brep cmd yet.

Saturday, July 8th, 2023[edit]

  • Learn about surface interporation in The NURBS book.

Sunday, July 9th, 2023[edit]

  • Learn about tensor product surface, as well as implemention in OpenNURBS.
  • Add brep .. surface tensor .. function.

Monday, July 11th-18th, 2023[edit]

  • One week away for meeting.
  • Update wiki about NURBS editing operations.

Friday, July 21th, 2023[edit]

  • Add surface revolutionfunction to create a NURBS surface by rotating a curve around an axis by an angle.

Saturday, July 22th, 2023[edit]

  • Learn about surface interporation in The NURBS book.

Tuesday, July 25th, 2023[edit]

  • Learn about the relationship between curve/surface continuity and knot multiplicity.
  • Learn about knot vector of cubic curve, check previous curve interpolation functions.

Wensday, July 26th, 2023[edit]

  • Implement u/v knot vector caculation of surface interpolation.

Friday, July 28th, 2023[edit]

  • Caculate du/dv of each given vertices.
  • Read math formula about Duv, edge span. They are really confusing.

Saturday, July 29th, 2023[edit]

  • Read math formula about global curve interpolation. It can achieve C2 continuity between knots.
  • Read math formula about global surface interpolation.

Sunday, July 30th, 2023[edit]

  • Implement global cubic curve interpolation.
  • Read math formula about global surface interpolation.

Monday, July 31th, 2023[edit]

  • Caculate knot vector while interpolating bicubic surface.
  • Implement some functions of global surface interpolation.

Tuesday, Augest 1st, 2023[edit]

  • Implement global surface interpolation with C2 continuity.
  • fix get_nurbs_surf.

Wensday, Augest 2nd, 2023[edit]

  • Write two shell script to test new features of milestone 2.
  • submit PR of milestone 2.

Thursday, Augest 3rd, 2023[edit]

  • Check code format according to HACKING.

Monday, Augest 7th, 2023[edit]

  • Run and check source codes of Ayma about NURBS operations.

Thursday, Auguest 10th, 2023[edit]

  • Check code logic about running "kill" after NURBS operations.
  • Configuring the environment on a new computer.

Friday, Auguest 11th, 2023[edit]

  • fix bugs, remove "kill" after NURBS operations. Do some tests.
  • fix bugs, fix memory management.

Sunday, Auguest 13th, 2023[edit]

  • Check topology cmds to be implemented and examples.
  • Add topology editing module.
  • Add create vertex cmd. (is a geometric operation, but is temporarily in the topology subcommand)

Monday, Auguest 14th, 2023[edit]

  • Fix error in curve id judgement.
  • Add create topology edge cmd.

Tuesday, Auguest 16th, 2023[edit]

  • Read codes about creating loops.
  • Write test code about triangular prism

Wensday, Auguest 17th, 2023[edit]

  • Create topo faces
  • Implement 'create loop' function
  • Write test code about triangular prism

Thursday, Auguest 18th, 2023[edit]

  • Add 'brep .. surface extract_curve ..' function
  • Add 'brep .. surface ext_v ..' function
  • Add 'brep .. topo create_l ..' function
  • Some code refactor

Saturday, Auguest 20th, 2023[edit]

  • Try to understand operations in parameter space.
  • Add 'brep .. curve make_2dline ..' cmd.

Sunday, Auguest 21th, 2023[edit]

  • Add 'brep .. topo create_l ..' function
  • Add 'brep .. topo create_t ..' function
  • Write test code about cube with a piece cut out

Monday, Auguest 22th, 2023[edit]

  • Reclassify nurbs editing operations into geometric and topological operations
  • Create 'brep .. geo' subcmd
  • Move 'create_v' cmd to geo subcmd
  • Write test code about cube with a piece cut out

Tuesday, Auguest 23th, 2023[edit]

  • Move all geometry commands to 'brep .. geo ..'
  • Move all topology commands to 'brep .. topo ..'
  • Add remove functions for curve2d,vertex
  • Some code refactor
  • Write test code about cube with a piece cut out