https://brlcad.org/w/api.php?action=feedcontributions&user=Plussai&feedformat=atomBRL-CAD - User contributions [en]2021-02-24T20:35:27ZUser contributionsMediaWiki 1.32.2https://brlcad.org/w/index.php?title=Community_Publication_Portal&diff=4597Community Publication Portal2012-11-15T09:12:09Z<p>Plussai: /* For surface tree */</p>
<hr />
<div>Welcome to the BRL-CAD community publication portal. This page is dedicated to the preparation and editing of BRL-CAD announcements. Proposed and upcoming topics are listed. Anyone is '''welcome and encouraged''' to share news about any activity related to BRL-CAD. Community editing and review are encouraged.<br />
<br />
__TOC__<br />
<br />
'''Formatting & Editing Standards:'''<br />
<br />
* Quotations are italicized and placed between double quotes ('' "Like This" '').<br />
<br />
* AA (All Acronyms) need to be defined upon first use, don't abbrev. words.<br />
<br />
* Section headings uppercase the major words and are in bold ('''Like This''')<br />
<br />
* Use the serial comma: one, two, and three; not one, two and three.<br />
<br />
* Cite references, include hyperlinks.<br />
<br />
* Keep it brief.<br />
<br />
'''Distribution Channels:'''<br />
<br />
For release publications, follow [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING HACKING]. For everything else, distribute to the following:<br />
<br />
* brlcad-news@lists.sourceforge.net<br />
* http://brlcad.org/d/node/add/story<br />
* https://sourceforge.net/news/?group_id=105292<br />
* (optional) https://brlcad.org/wiki/<br />
* (optional) http://www.tenlinks.com/NEWS/tl_daily/submit_news.htm<br />
* (optional) http://upfrontezine.com<br />
<br />
----<br />
----<br />
<br />
== Ready for Publication ==<br />
These articles are ready for publication. Release notes should be posted after tarballs, ideally the last or first week of a month. Other publications should be scheduled one or two weeks later, ideally on the second or third week of the month.<br />
<br />
Note: if you see a comment indicating that a section is FROZEN, any changes you make in that section may go unnoticed as the article is being prepared for distribution. If you find errors in a FROZEN article, go ahead and correct the article but contact Sean (brlcad on freenode [[IRC]]) who may be able to incorporate changes during final publication.<br />
<br />
==== Move from Final Review to Here When Ready====<br />
<br />
<br />
----<br />
<br />
== Final Editorial Review ==<br />
These should be "complete" articles. The author is done. All that remains is a structure, grammar, voice, punctuation, and spelling review. Images welcome.<br />
<br />
==== Kyle Bodt: Ronja ====<br />
<br />
http://brlcad.org/wiki/Ronja<br />
<br />
Ronja (Reasonable Optical Near Joint Access) is an innovative piece of equipment that utilizes reliable optical data links to create a current communication range of 1.4 km and a speed of 10Mbps full duplex that can be used as a general purpose wireless link for virtually any networking project. This is a very important project for Twibright Labs, a small group of computer science graduate students operating out of Charles University in Prague in the Czech Republic. The group specializes in the usage of Free Software and User Controlled Technology Development.<br />
<br />
The primary output for the Ronja project is a design. The lab does not intend to manufacture and sell the hardware that is being designed but wants to engage in open source development of the technology. The philosophy surrounding User Controlled Technology is the ideal that the end-user is provided with unrestricted access to the intellectual property surrounding the technology, including the tools that are being used to create it. One tool playing an integral part in the development of the Ronja designs is BRL-CAD. All of the models that Twibright labs use to display the different variants of their Ronja concept were created with the help of BRL-CAD. BRL-CAD has allowed the members of Twibright labs to create instructional diagrams so that the users and builders of their open source technology will be able to have the latest information with regard to the proper construction of a Ronja unit. The interactive geometry editor and ray-tracers in BRL-CAD are an integral part in the communication of design plans for Twibright labs and enables them to connect with the users, who are the driving force behind the User Controlled Technology ideal.<br />
<br />
----<br />
<br />
== Initial Drafts ==<br />
These are incomplete articles being worked on. Short 250 to 500-word articles (not counting tables, images, etc) are usually perfect.<br />
<br />
==== Anurag Murty: Voxelizing Geometry ====<br />
Given a set of primitives as input, the voxelize command uses the data obtained from BRL-CAD's raytracer to represent the input in the form of voxels(Volumetric Picture Elements). A uniform grid of rays is uniformly shot on the given input and an approximation of the volume filled in each voxel region is made from the raytracing data. Depending on the approximate volume of the voxel filled, a voxel is classified as IN or OUT of the voxelized output. The voxels are represented as RPPs. <br />
Such voxelized outputs have applications in Volumetric rendering and finite element analysis.<br />
<br />
SYNTAX : <br />
voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]<br />
<br />
ARGUMENTS-<br />
<br />
-d - Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values<br />
<br />
-s - Specifies the voxel size in each direction. <br />
<br />
-t - Specifies the threshold volume to decide if voxel is to be included in the voxelized output. <br />
<br />
new_obj - Name for resultant primitive that is a region containing the resulting voxels. <br />
<br />
old_obj - Name of source primitive or collection.<br />
<br />
<br />
NOTES- <br />
<br />
1. A greater level of detail usually implies a much better approximation of fill volumes at the cost of more computations.<br />
<br />
2. Lesser voxel sizes give a more precise representation of the input at the cost of more memory requirements.<br />
<br />
3. Threshold value (the argument of -t) should be a value between 0 and 1, and not a percentage.<br />
<br />
==== Cristina Precup: Visualizing Directed Acyclic Graphs ====<br />
'''Visualizing Constructive Solid Geometry''' is a project meant to illustrate in an intuitive and interactive manner the hierarchical structure of .g geometry databases.<br />
<br />
For the representation of the hierarchies, the '''Adaptagrams''' graph library has been used. This made possible organizing the objects contained within the database into directed acyclic graphs.<br />
<br />
Following, are the steps that have been taken in developing the graph layout API:<br />
<br />
* Integrate the Adaptagrams library into BRL-CAD.<br />
* Traverse the geometry database and distinguish different types of objects (''primitive'', ''combination'', ''non-geometry'') within it, as well as, establish the operations between them (''union'', ''difference'', ...). Add all this data to the graph structure constructed with Adaptagrams.<br />
* Display the objects using a Tk Canvas widget inside a window.<br />
* Develop a ''decorative routine'' that sets different colors for different types of objects, correspondingly.<br />
* Create a name label for each represented object.<br />
* Develop a layout algorithm that aligns the nodes of the graph in a hierarchical way.<br />
* Introduce the '''graph''' command in both '''MGED''' and '''Archer'''. It has two subcommands:<br />
** '''show''' which displays a list with the name and type of the objects along with the nodes' and edges' positions;<br />
** '''positions''' that lists the names, types and positions of the corresponding nodes within the graph;<br />
* Introduce the '''igraph''' command in both MGED and Archer. This command pops up a graph based visualization window of the currently opened .g database. Its documentation can be found in ''brlman''.<br />
<br />
As an example, here is how the graph for the ''share/db/axis.g'' database looks like now:<br />
:[[Image:Graph_editor_v2.png]]<br />
<br />
Further work that can extend the ''interactive'' trait of the graph layout API includes adding user actions upon the graph such as ''move'' (dragging a node) or ''delete'' functionalities.<br />
<br />
==== Ksenija Slivko: Reducing Code ====<br />
<br />
===== Abstract =====<br />
The main aim of this project was to decrease the number of lines of code in the project. Since the project is being developing for quite a long time there were many "copy-pastes". They were redacted. <br />
<br />
===== The process of developing =====<br />
Coding period can be divided into three parts:<br />
* reduction in the single files<br />
* reduction in different files in the single program or library<br />
* reduction in different libraries<br />
<br />
===== Improving =====<br />
Since the project is quite large the redaction can be continued<br />
<br />
==== Laijiren: NURBS Tessellation: What, Why, How? ====<br />
===== Abstract =====<br />
Non-Uniform Rational B-Spline surfaces are widely used in CAD system. But they are not suitable for direct visualization on modern GPU systems. Today’s graphics hardware supports the high-speed display of polygonal objects consisting of triangles. This means that analytical surfaces (like NURBS) need to be triangulated so they can be displayed by 3D graphics cards.<br />
<br />
===== Main work =====<br />
===== For debugging tool =====<br />
*add 'info TB' 'info SB' to display information of piecewise bezier trim curve<br />
*add 'info T' 'info E' to display information of trim curve in parameter region and edge in 3d region<br />
*add 'plot SCV' to display control point net and 'plot TESS' to display the result of tessellation<br />
<br />
===== For surface tree =====<br />
*subdivide a Nurbs surface in a adaptive method and a new recursion termination condition for surface subdivision.<br />
reference:NURBS rendering in OpenSG Plus<br />
*implement the doTrimming function in Surface tree.<br />
1)compute the intersection between trim curve and rect's edge of sub-surface in parameter region<br />
<br />
2)implement a trimLoop class to get the valid loop and the trimmed loop<br />
<br />
3)triangulate the valid loop in form of polygon<br />
<br />
==== Suryajith Chillara: Benchmark Performance Database ====<br />
===== Abstract =====<br />
The main idea is to store the data both in the database and the log files stored in the archive. The storage in the database enables the content to be searched via the parameters such as machine descriptions, versions, results and could be compared. The storage as a file in the archive is to maintain a back up of the file and whenever a developer needs a specific bunch of benchmark logs, he could get them from the archive with or without the help of the database.<br />
<br />
===== Main Components =====<br />
* '''Log Parser :''' The data of the log file needs to be parsed and the relevant and important information has to be logged in the database so as to make the data access for the graphic display through the frontend could be made possible. <br />
* '''Web API :''' Implemented via the bottle framework so as to submit the logs from the brlcad installation via scripts.<br />
* '''Web backend :''' A backend has been implemented as a MVC framework from scratch using the python bottle framework. <br />
* '''Frontend :''' The website that can offer multiple mechanisms for adding new performance run data into the database and provide multiple graphical and non-graphical visualizations of aggregate performance data (i.e., graphs, charts, tables, etc). Graphs, tables and charts are generated with the help of Google Charts via wrapper which generates the javascript code to interact with the Google Charts service.<br />
[[Image:Absavgperfvsimagescomb.png]]<br />
<br />
<br />
Plumbing between these components is via the python scripts. <br />
<br />
<br />
===== Tool & Service dependancies =====<br />
* Python 2.7 and libraries<br />
* Bottle web framework<br />
* MySQL<br />
* Google Charts<br />
<br />
==== Wu Jianbang: NURBS surface-surface intersections ====<br />
I focused on the "NURBS surface-surface intersections" project after the mid-term evaluation of this year's GSoC, before which I worked on converting implicit primitives to NURBS B-rep forms.<br />
<br />
The function calculating NURBS surface-surface intersection curves is surface_surface_intersection() which is declared in include/nurbs.h and implemented in src/libnurbs/opennurbs_ext.cpp. It outputs intersection curves in 3d space and in both surfaces' UV parameter spaces.<br />
<br />
The approach of the algorithm originates from:<br />
<br />
Adarsh Krishnamurthy, Rahul Khardekar, Sara McMains, Kirk Haller, and Gershon Elber. 2008. Performing efficient NURBS modeling operations on the GPU. In Proceedings of the 2008 ACM symposium on Solid and physical modeling (SPM '08). ACM, New York, NY, USA, 257-268. DOI=10.1145/1364901.1364937 http://doi.acm.org/10.1145/1364901.1364937<br />
<br />
It can be divided into several steps:<br />
<br />
* Generate the bounding box of the two surfaces.<br />
* If their bounding boxes intersect:<br />
** Split the two surfaces, both into four parts, and calculate the sub-surfaces' bounding boxes<br />
** Calculate the intersection of sub-surfaces' bboxes, if they do intersect, go deeper with splitting surfaces and smaller bboxes, otherwise trace back.<br />
* After getting the intersecting bboxes, approximate the surface inside the bbox with two triangles, and calculate the intersection points of the triangles (both in 3d space and two surfaces' UV space)<br />
* Fit the intersection points into polyline curves, and then to NURBS curves. Points with distance less than max_dis are considered in one curve.<br />
<br />
It needs to be mentioned here that the value max_dis can be provided by the user or generated automatically.<br />
<br />
Besides, after calculating the intersection curves, the next steps towords evaluated NURBS are splitting the surfaces into sub-surfaces with the intersection curves as their boundaries, and some inside-outside tests to decide which sub-surfaces should be included in the final object. Some work on splitting has been done, generating some b-rep faces that can pass IsValid(), but still further work is needed.<br />
<br />
==== Andrei Popescu: Network Performance Testing ====<br />
<br />
The project that I have been working on during the summer, as part of the Google Summer of Code program,<br> can be broken down into three independent parts and it consisted in running various tests for the BRL-CAD<br> networking library(Libpkg) .<br />
<br />
*Speed testing and investigations to uncover any potential performance bottleneck.<br />
*Unit tests and code review to find and cover any untreated exceptions(crashes) in the Libpkg library.<br />
*Eliminate the assumption of globals in the API.<br />
<br />
For the first part, I have run two types of tests : <br><br />
<br />
Local ones, both the "sender" and the "receiver" were located on localhost.<br />
The script gathered data<br> regarding the transmission speed for each set of package sizes (Here, package refers to the package <br>created by networking library, not networking packages) respectively file sizes.<br />
<br />
Remote ones, where the "sender" and the "receiver" were on separate machines, connected using SSH.<br> The script ran and the data gathered was done in the same way as the localhost one.Using the data <br> obtained from the tests, two 3D graphs were drawn.However, the tests were inconclusive, I could not find<br> an "ideal" package size to use regardless of file size.<br />
<br />
After Mid-term I focused mostly on second part. I used test units from libbu(Utility library) as an example<br> for the unit test type and design.<br />
When the mentioned tests were run, several exceptions that caused<br> crashes were discovered. Lastly, I have written fixes for the discovered crashes.<br />
<br />
The third part of the project has not been covered yet, so more work is needed.Although, I am doing my<br> best to finish it in the following weeks.<br />
<br />
==== Chris Dueck: Calculating 2D Sketch Surface Area ====<br />
<br />
Calculating the surface area of a 2D Sketch primitive is not a trivial task. Sketches are created interactively by the user, and can contain straight line segments, circular arc segments (and full circles), as well as Bezier and NURBS curves.<br />
<br />
The method used to approximately compute the area of a 2D sketch is as follows:<br />
<br />
*1.) Approximate the sketch by a polygon<br />
*2.) Compute the area of the polygon exactly using Green's Theorem<br />
*3.) Add the areas of any circular arc segments that were created during (1)<br />
<br />
To approximate the sketch by a polygon, each possible curve type of a sketch must be considered.<br />
<br />
*If the curve is a straight line, it need not be approximated.<br />
<br />
*If the curve is a circular arc, it must be determined if it is a full circle (in which case its area can be computed easily) or if it is a circular arc segment. If it is a circular arc segment, the line segment from the beginning of the arc to the endpoint is added to the polygon, and the excess area of the circular arc segment itself can be calculated easily (https://en.wikipedia.org/wiki/Circular_segment)<br />
<br />
*If the curve is a Bezier curve, it can be approximated by a series of circular arcs. The algorithm used can be found here (http://itc.ktu.lt/itc354/Riskus354.pdf). The algorithm recursively subdivides the Bezier until it is approximated to tolerance by a biarc and uses the curvature value of the Bezier at a point to determine the depth of subdivision. Then each circular arc in the approximation of the Bezier curve is treated as above.<br />
<br />
Finally, the area of the polygon can be efficiently calculated using Green's Theorem (http://www.softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#3D%20Standard%20Formula) using cross products.<br />
<br />
==== Cliff Yapp: NURBS Ray Tracing in BRL-CAD ====<br />
<br />
Over the past year, an intense development effort by BRL-CAD's development team has successfully implemented raytracing of Non-Uniform Rational BSpline (NURBS) geometry within the BRL-CAD Computer-Aided Design (CAD) package. NURBS surfaces are very general, very complex mathematical shapes used by virtually all modern commercial CAD software packages. Because BRL-CAD did not originally support this type of geometry, commercial models could only be imported into BRL-CAD after a labor-intensive and difficult conversion process from NURBS form to triangle-base geometry (referred to in BRL-CAD as Bags-of-Triangles or BoTs). The new NURBS raytracing capability builds on work by many developers over a period of years, who in turn built on the open source library OpenNURBS. Support for this primitive type means BRL-CAD can now store and raytrace data from commercial models without requiring preliminary conversion to another type of geometry.<br />
<br />
The last major feature needed to make import of commercial models in BRL-CAD straightforward is conversion support for ISO’s "Standard for the Exchange of Product model data" or STEP file format. STEP uses NURBS geometry in its definition, making support for NURBS geometry a necessary prelude to support for STEP import. Most commercial CAD modelers support this file format as an output option, hence STEP support in BRL-CAD would allow a direct path for moving geometric descriptions from a variety of commercial modelers to BRL-CAD. Considerable progress has already been made on STEP import support, but more work is need to bring the code and feature set to "production quality". If anyone would like to join the BRL-CAD open source development effort and has a little familiarity with C++, the step-g converter and its supporting libraries have some simple-yet-useful tasks that would be an excellent and very useful way to explore the project - join BRL-CAD's IRC channel or development email list if you are interested!<br />
<br />
==== Erik Greenwald: Bolting ADRT's libtie under the hood ====<br />
<br />
[[Image:BoTvsTie.png|right|thumb|256px|BoT vs Tie pixdiff]]<br />
<br />
Initial progress on the integration of ADRT's libtie "triangle intersection engine" with LIBRT.<br />
<br />
----<br />
<br />
== Idea Hopper ==<br />
These are ideas for interesting or useful publications. We need someone to at least write a draft.<br />
<br />
==== BRL-CAD's Evolutionary API ====<br />
<br />
Talk about BRL-CAD deprecation process.<br />
<br />
==== Introduction to new .deb and .rpm builds ====<br />
<br />
Brief article overviewing the efforts by jordisayol for Debian, Ubuntu, Fedora, and openSUSE. Included are new icons, menu items, mime type associations, and more.<br />
<br />
==== 2010 End Of Year Review ====<br />
<br />
Article giving an overview of the past year's highlight developments with hints at what 2011 may bring. Alternatively, may be the annual statistics review if we switch from fiscal to calendar year reporting.<br />
<br />
==== Erik Greenwald: ADRT/ISST Visualization ====<br />
<br />
Article introducing ADRT/ISST core capability.<br />
<br />
==== Bob Parker: Alpha Archer: Working Towards Next Generation MGED ====<br />
<br />
Article introducing Archer's core new features that will be "coming" to MGED. Undo, interactive editing, tree view, and info panels come to mind.<br />
<br />
==== Finding the Hot Spots ====<br />
<br />
Article on the rt lighting model Stephen Kennedy developed that visualizes the time spent per-pixel.<br />
<br />
==== Point Clouds ====<br />
<br />
Article introducing the new point cloud primitive.<br />
<br />
==== bn_mat_inv: singular matrix ====<br />
<br />
Article on the v4 format and binary compatibility.<br />
<br />
==== Model Showcase: Goliath ====<br />
<br />
Article talking about the making of the Goliath model.<br />
<br />
==== Model Showcase: Chumaciera ====<br />
<br />
Article on Pedro Baptista's bearing model.<br />
<br />
==== Model Showcase: Proyecto Catapulta ====<br />
<br />
Article on a model developed by André Santos, António Almeida, and Pedro Ferreira.<br />
<br />
==== Model Showcase: Union Coupling Tool ====<br />
<br />
Article on a model developed by Inês de Matos under teacher Luís Ferreira. The project focuses on a tool, union coupling, based on the book, http://purl.pt/14352 , page 122 of the original book and page 128 of the file, figures 108 and 109.<br />
<br />
==== Geometry Service FAQ ====<br />
<br />
FAQ summarization of the GS as it pertains to the wider open source community.<br />
<br />
==== BRL-CAD's 3rd Generation Build System ====<br />
<br />
Article on the new CMake build system.<br />
<br />
==== BRL-CAD's Open Source Vision ====<br />
<br />
Article introducing the Project Priorities diagram and overall project vision.<br />
<br />
==== BRL-CAD Primitives Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's primitives and their current status.<br />
<br />
==== BRL-CAD Geometry Converter Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's geometry converters.<br />
<br />
==== Release Schedule ====<br />
<br />
Explain our release schedule and versioning system.<br />
<br />
==== RTGL ====<br />
<br />
Article on Nick's point-based visualization mode.<br />
<br />
==== BRL-CAD Quick Reference Card ====<br />
<br />
Article on a BRL-CAD QRC similar to the existing MGED QRC.<br />
<br />
==== BRL-CAD Bibliography ====<br />
<br />
After the .bib gets published to the website, an article announcing it and soliciting additions.<br />
<br />
==== Revolve Primitive ====<br />
<br />
Article on Timothy Van Ruitenbeek's work implementing 'revolve'.<br />
<br />
==== Parametrics and Constraints ====<br />
<br />
Article on Dawn Thomas' work to integrate parametric equation and constraint evaluation support.<br />
<br />
==== Converting Implicit to Explicit: CSG to BREP NURBS ====<br />
<br />
Article on the work by Cliff Yapp, Joe Doliner, and Ben Poole converting primitives with an implicit representation into an explicit NURBS representation.<br />
<br />
==== Online Model Repository ====<br />
<br />
Article on Elena Băutu's work developing the model repository website.<br />
<br />
==== Project Statistics for 2010 ====<br />
<br />
Article on our current stats similar to previous years.<br />
<br />
==== Next Generation BRL-CAD ====<br />
<br />
Article on our super secret awesome new GUI.</div>Plussaihttps://brlcad.org/w/index.php?title=Community_Publication_Portal&diff=4596Community Publication Portal2012-11-15T09:10:43Z<p>Plussai: /* For surface tree */</p>
<hr />
<div>Welcome to the BRL-CAD community publication portal. This page is dedicated to the preparation and editing of BRL-CAD announcements. Proposed and upcoming topics are listed. Anyone is '''welcome and encouraged''' to share news about any activity related to BRL-CAD. Community editing and review are encouraged.<br />
<br />
__TOC__<br />
<br />
'''Formatting & Editing Standards:'''<br />
<br />
* Quotations are italicized and placed between double quotes ('' "Like This" '').<br />
<br />
* AA (All Acronyms) need to be defined upon first use, don't abbrev. words.<br />
<br />
* Section headings uppercase the major words and are in bold ('''Like This''')<br />
<br />
* Use the serial comma: one, two, and three; not one, two and three.<br />
<br />
* Cite references, include hyperlinks.<br />
<br />
* Keep it brief.<br />
<br />
'''Distribution Channels:'''<br />
<br />
For release publications, follow [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING HACKING]. For everything else, distribute to the following:<br />
<br />
* brlcad-news@lists.sourceforge.net<br />
* http://brlcad.org/d/node/add/story<br />
* https://sourceforge.net/news/?group_id=105292<br />
* (optional) https://brlcad.org/wiki/<br />
* (optional) http://www.tenlinks.com/NEWS/tl_daily/submit_news.htm<br />
* (optional) http://upfrontezine.com<br />
<br />
----<br />
----<br />
<br />
== Ready for Publication ==<br />
These articles are ready for publication. Release notes should be posted after tarballs, ideally the last or first week of a month. Other publications should be scheduled one or two weeks later, ideally on the second or third week of the month.<br />
<br />
Note: if you see a comment indicating that a section is FROZEN, any changes you make in that section may go unnoticed as the article is being prepared for distribution. If you find errors in a FROZEN article, go ahead and correct the article but contact Sean (brlcad on freenode [[IRC]]) who may be able to incorporate changes during final publication.<br />
<br />
==== Move from Final Review to Here When Ready====<br />
<br />
<br />
----<br />
<br />
== Final Editorial Review ==<br />
These should be "complete" articles. The author is done. All that remains is a structure, grammar, voice, punctuation, and spelling review. Images welcome.<br />
<br />
==== Kyle Bodt: Ronja ====<br />
<br />
http://brlcad.org/wiki/Ronja<br />
<br />
Ronja (Reasonable Optical Near Joint Access) is an innovative piece of equipment that utilizes reliable optical data links to create a current communication range of 1.4 km and a speed of 10Mbps full duplex that can be used as a general purpose wireless link for virtually any networking project. This is a very important project for Twibright Labs, a small group of computer science graduate students operating out of Charles University in Prague in the Czech Republic. The group specializes in the usage of Free Software and User Controlled Technology Development.<br />
<br />
The primary output for the Ronja project is a design. The lab does not intend to manufacture and sell the hardware that is being designed but wants to engage in open source development of the technology. The philosophy surrounding User Controlled Technology is the ideal that the end-user is provided with unrestricted access to the intellectual property surrounding the technology, including the tools that are being used to create it. One tool playing an integral part in the development of the Ronja designs is BRL-CAD. All of the models that Twibright labs use to display the different variants of their Ronja concept were created with the help of BRL-CAD. BRL-CAD has allowed the members of Twibright labs to create instructional diagrams so that the users and builders of their open source technology will be able to have the latest information with regard to the proper construction of a Ronja unit. The interactive geometry editor and ray-tracers in BRL-CAD are an integral part in the communication of design plans for Twibright labs and enables them to connect with the users, who are the driving force behind the User Controlled Technology ideal.<br />
<br />
----<br />
<br />
== Initial Drafts ==<br />
These are incomplete articles being worked on. Short 250 to 500-word articles (not counting tables, images, etc) are usually perfect.<br />
<br />
==== Anurag Murty: Voxelizing Geometry ====<br />
Given a set of primitives as input, the voxelize command uses the data obtained from BRL-CAD's raytracer to represent the input in the form of voxels(Volumetric Picture Elements). A uniform grid of rays is uniformly shot on the given input and an approximation of the volume filled in each voxel region is made from the raytracing data. Depending on the approximate volume of the voxel filled, a voxel is classified as IN or OUT of the voxelized output. The voxels are represented as RPPs. <br />
Such voxelized outputs have applications in Volumetric rendering and finite element analysis.<br />
<br />
SYNTAX : <br />
voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]<br />
<br />
ARGUMENTS-<br />
<br />
-d - Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values<br />
<br />
-s - Specifies the voxel size in each direction. <br />
<br />
-t - Specifies the threshold volume to decide if voxel is to be included in the voxelized output. <br />
<br />
new_obj - Name for resultant primitive that is a region containing the resulting voxels. <br />
<br />
old_obj - Name of source primitive or collection.<br />
<br />
<br />
NOTES- <br />
<br />
1. A greater level of detail usually implies a much better approximation of fill volumes at the cost of more computations.<br />
<br />
2. Lesser voxel sizes give a more precise representation of the input at the cost of more memory requirements.<br />
<br />
3. Threshold value (the argument of -t) should be a value between 0 and 1, and not a percentage.<br />
<br />
==== Cristina Precup: Visualizing Directed Acyclic Graphs ====<br />
'''Visualizing Constructive Solid Geometry''' is a project meant to illustrate in an intuitive and interactive manner the hierarchical structure of .g geometry databases.<br />
<br />
For the representation of the hierarchies, the '''Adaptagrams''' graph library has been used. This made possible organizing the objects contained within the database into directed acyclic graphs.<br />
<br />
Following, are the steps that have been taken in developing the graph layout API:<br />
<br />
* Integrate the Adaptagrams library into BRL-CAD.<br />
* Traverse the geometry database and distinguish different types of objects (''primitive'', ''combination'', ''non-geometry'') within it, as well as, establish the operations between them (''union'', ''difference'', ...). Add all this data to the graph structure constructed with Adaptagrams.<br />
* Display the objects using a Tk Canvas widget inside a window.<br />
* Develop a ''decorative routine'' that sets different colors for different types of objects, correspondingly.<br />
* Create a name label for each represented object.<br />
* Develop a layout algorithm that aligns the nodes of the graph in a hierarchical way.<br />
* Introduce the '''graph''' command in both '''MGED''' and '''Archer'''. It has two subcommands:<br />
** '''show''' which displays a list with the name and type of the objects along with the nodes' and edges' positions;<br />
** '''positions''' that lists the names, types and positions of the corresponding nodes within the graph;<br />
* Introduce the '''igraph''' command in both MGED and Archer. This command pops up a graph based visualization window of the currently opened .g database. Its documentation can be found in ''brlman''.<br />
<br />
As an example, here is how the graph for the ''share/db/axis.g'' database looks like now:<br />
:[[Image:Graph_editor_v2.png]]<br />
<br />
Further work that can extend the ''interactive'' trait of the graph layout API includes adding user actions upon the graph such as ''move'' (dragging a node) or ''delete'' functionalities.<br />
<br />
==== Ksenija Slivko: Reducing Code ====<br />
<br />
===== Abstract =====<br />
The main aim of this project was to decrease the number of lines of code in the project. Since the project is being developing for quite a long time there were many "copy-pastes". They were redacted. <br />
<br />
===== The process of developing =====<br />
Coding period can be divided into three parts:<br />
* reduction in the single files<br />
* reduction in different files in the single program or library<br />
* reduction in different libraries<br />
<br />
===== Improving =====<br />
Since the project is quite large the redaction can be continued<br />
<br />
==== Laijiren: NURBS Tessellation: What, Why, How? ====<br />
===== Abstract =====<br />
Non-Uniform Rational B-Spline surfaces are widely used in CAD system. But they are not suitable for direct visualization on modern GPU systems. Today’s graphics hardware supports the high-speed display of polygonal objects consisting of triangles. This means that analytical surfaces (like NURBS) need to be triangulated so they can be displayed by 3D graphics cards.<br />
<br />
===== Main work =====<br />
===== For debugging tool =====<br />
*add 'info TB' 'info SB' to display information of piecewise bezier trim curve<br />
*add 'info T' 'info E' to display information of trim curve in parameter region and edge in 3d region<br />
*add 'plot SCV' to display control point net and 'plot TESS' to display the result of tessellation<br />
<br />
===== For surface tree =====<br />
*subdivide a Nurbs surface in a adaptive method and a new recursion termination condition for surface subdivision.<br />
reference:NURBS rendering in OpenSG Plus<br />
*implement the doTrimming function in Surface tree.<br />
1)compute the intersection between trim curve and rect's edge of sub-surface in parameter region<br />
<br />
2)implement a trimLoop class to get the valid loop and the trimmed loop<br />
<br />
3)triangulate the valid loop in form of polygon<br />
<br />
==== Suryajith Chillara: Benchmark Performance Database ====<br />
===== Abstract =====<br />
The main idea is to store the data both in the database and the log files stored in the archive. The storage in the database enables the content to be searched via the parameters such as machine descriptions, versions, results and could be compared. The storage as a file in the archive is to maintain a back up of the file and whenever a developer needs a specific bunch of benchmark logs, he could get them from the archive with or without the help of the database.<br />
<br />
===== Main Components =====<br />
* '''Log Parser :''' The data of the log file needs to be parsed and the relevant and important information has to be logged in the database so as to make the data access for the graphic display through the frontend could be made possible. <br />
* '''Web API :''' Implemented via the bottle framework so as to submit the logs from the brlcad installation via scripts.<br />
* '''Web backend :''' A backend has been implemented as a MVC framework from scratch using the python bottle framework. <br />
* '''Frontend :''' The website that can offer multiple mechanisms for adding new performance run data into the database and provide multiple graphical and non-graphical visualizations of aggregate performance data (i.e., graphs, charts, tables, etc). Graphs, tables and charts are generated with the help of Google Charts via wrapper which generates the javascript code to interact with the Google Charts service.<br />
[[Image:Absavgperfvsimagescomb.png]]<br />
<br />
<br />
Plumbing between these components is via the python scripts. <br />
<br />
<br />
===== Tool & Service dependancies =====<br />
* Python 2.7 and libraries<br />
* Bottle web framework<br />
* MySQL<br />
* Google Charts<br />
<br />
==== Wu Jianbang: NURBS surface-surface intersections ====<br />
I focused on the "NURBS surface-surface intersections" project after the mid-term evaluation of this year's GSoC, before which I worked on converting implicit primitives to NURBS B-rep forms.<br />
<br />
The function calculating NURBS surface-surface intersection curves is surface_surface_intersection() which is declared in include/nurbs.h and implemented in src/libnurbs/opennurbs_ext.cpp. It outputs intersection curves in 3d space and in both surfaces' UV parameter spaces.<br />
<br />
The approach of the algorithm originates from:<br />
<br />
Adarsh Krishnamurthy, Rahul Khardekar, Sara McMains, Kirk Haller, and Gershon Elber. 2008. Performing efficient NURBS modeling operations on the GPU. In Proceedings of the 2008 ACM symposium on Solid and physical modeling (SPM '08). ACM, New York, NY, USA, 257-268. DOI=10.1145/1364901.1364937 http://doi.acm.org/10.1145/1364901.1364937<br />
<br />
It can be divided into several steps:<br />
<br />
* Generate the bounding box of the two surfaces.<br />
* If their bounding boxes intersect:<br />
** Split the two surfaces, both into four parts, and calculate the sub-surfaces' bounding boxes<br />
** Calculate the intersection of sub-surfaces' bboxes, if they do intersect, go deeper with splitting surfaces and smaller bboxes, otherwise trace back.<br />
* After getting the intersecting bboxes, approximate the surface inside the bbox with two triangles, and calculate the intersection points of the triangles (both in 3d space and two surfaces' UV space)<br />
* Fit the intersection points into polyline curves, and then to NURBS curves. Points with distance less than max_dis are considered in one curve.<br />
<br />
It needs to be mentioned here that the value max_dis can be provided by the user or generated automatically.<br />
<br />
Besides, after calculating the intersection curves, the next steps towords evaluated NURBS are splitting the surfaces into sub-surfaces with the intersection curves as their boundaries, and some inside-outside tests to decide which sub-surfaces should be included in the final object. Some work on splitting has been done, generating some b-rep faces that can pass IsValid(), but still further work is needed.<br />
<br />
==== Andrei Popescu: Network Performance Testing ====<br />
<br />
The project that I have been working on during the summer, as part of the Google Summer of Code program,<br> can be broken down into three independent parts and it consisted in running various tests for the BRL-CAD<br> networking library(Libpkg) .<br />
<br />
*Speed testing and investigations to uncover any potential performance bottleneck.<br />
*Unit tests and code review to find and cover any untreated exceptions(crashes) in the Libpkg library.<br />
*Eliminate the assumption of globals in the API.<br />
<br />
For the first part, I have run two types of tests : <br><br />
<br />
Local ones, both the "sender" and the "receiver" were located on localhost.<br />
The script gathered data<br> regarding the transmission speed for each set of package sizes (Here, package refers to the package <br>created by networking library, not networking packages) respectively file sizes.<br />
<br />
Remote ones, where the "sender" and the "receiver" were on separate machines, connected using SSH.<br> The script ran and the data gathered was done in the same way as the localhost one.Using the data <br> obtained from the tests, two 3D graphs were drawn.However, the tests were inconclusive, I could not find<br> an "ideal" package size to use regardless of file size.<br />
<br />
After Mid-term I focused mostly on second part. I used test units from libbu(Utility library) as an example<br> for the unit test type and design.<br />
When the mentioned tests were run, several exceptions that caused<br> crashes were discovered. Lastly, I have written fixes for the discovered crashes.<br />
<br />
The third part of the project has not been covered yet, so more work is needed.Although, I am doing my<br> best to finish it in the following weeks.<br />
<br />
==== Chris Dueck: Calculating 2D Sketch Surface Area ====<br />
<br />
Calculating the surface area of a 2D Sketch primitive is not a trivial task. Sketches are created interactively by the user, and can contain straight line segments, circular arc segments (and full circles), as well as Bezier and NURBS curves.<br />
<br />
The method used to approximately compute the area of a 2D sketch is as follows:<br />
<br />
*1.) Approximate the sketch by a polygon<br />
*2.) Compute the area of the polygon exactly using Green's Theorem<br />
*3.) Add the areas of any circular arc segments that were created during (1)<br />
<br />
To approximate the sketch by a polygon, each possible curve type of a sketch must be considered.<br />
<br />
*If the curve is a straight line, it need not be approximated.<br />
<br />
*If the curve is a circular arc, it must be determined if it is a full circle (in which case its area can be computed easily) or if it is a circular arc segment. If it is a circular arc segment, the line segment from the beginning of the arc to the endpoint is added to the polygon, and the excess area of the circular arc segment itself can be calculated easily (https://en.wikipedia.org/wiki/Circular_segment)<br />
<br />
*If the curve is a Bezier curve, it can be approximated by a series of circular arcs. The algorithm used can be found here (http://itc.ktu.lt/itc354/Riskus354.pdf). The algorithm recursively subdivides the Bezier until it is approximated to tolerance by a biarc and uses the curvature value of the Bezier at a point to determine the depth of subdivision. Then each circular arc in the approximation of the Bezier curve is treated as above.<br />
<br />
Finally, the area of the polygon can be efficiently calculated using Green's Theorem (http://www.softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#3D%20Standard%20Formula) using cross products.<br />
<br />
==== Cliff Yapp: NURBS Ray Tracing in BRL-CAD ====<br />
<br />
Over the past year, an intense development effort by BRL-CAD's development team has successfully implemented raytracing of Non-Uniform Rational BSpline (NURBS) geometry within the BRL-CAD Computer-Aided Design (CAD) package. NURBS surfaces are very general, very complex mathematical shapes used by virtually all modern commercial CAD software packages. Because BRL-CAD did not originally support this type of geometry, commercial models could only be imported into BRL-CAD after a labor-intensive and difficult conversion process from NURBS form to triangle-base geometry (referred to in BRL-CAD as Bags-of-Triangles or BoTs). The new NURBS raytracing capability builds on work by many developers over a period of years, who in turn built on the open source library OpenNURBS. Support for this primitive type means BRL-CAD can now store and raytrace data from commercial models without requiring preliminary conversion to another type of geometry.<br />
<br />
The last major feature needed to make import of commercial models in BRL-CAD straightforward is conversion support for ISO’s "Standard for the Exchange of Product model data" or STEP file format. STEP uses NURBS geometry in its definition, making support for NURBS geometry a necessary prelude to support for STEP import. Most commercial CAD modelers support this file format as an output option, hence STEP support in BRL-CAD would allow a direct path for moving geometric descriptions from a variety of commercial modelers to BRL-CAD. Considerable progress has already been made on STEP import support, but more work is need to bring the code and feature set to "production quality". If anyone would like to join the BRL-CAD open source development effort and has a little familiarity with C++, the step-g converter and its supporting libraries have some simple-yet-useful tasks that would be an excellent and very useful way to explore the project - join BRL-CAD's IRC channel or development email list if you are interested!<br />
<br />
==== Erik Greenwald: Bolting ADRT's libtie under the hood ====<br />
<br />
[[Image:BoTvsTie.png|right|thumb|256px|BoT vs Tie pixdiff]]<br />
<br />
Initial progress on the integration of ADRT's libtie "triangle intersection engine" with LIBRT.<br />
<br />
----<br />
<br />
== Idea Hopper ==<br />
These are ideas for interesting or useful publications. We need someone to at least write a draft.<br />
<br />
==== BRL-CAD's Evolutionary API ====<br />
<br />
Talk about BRL-CAD deprecation process.<br />
<br />
==== Introduction to new .deb and .rpm builds ====<br />
<br />
Brief article overviewing the efforts by jordisayol for Debian, Ubuntu, Fedora, and openSUSE. Included are new icons, menu items, mime type associations, and more.<br />
<br />
==== 2010 End Of Year Review ====<br />
<br />
Article giving an overview of the past year's highlight developments with hints at what 2011 may bring. Alternatively, may be the annual statistics review if we switch from fiscal to calendar year reporting.<br />
<br />
==== Erik Greenwald: ADRT/ISST Visualization ====<br />
<br />
Article introducing ADRT/ISST core capability.<br />
<br />
==== Bob Parker: Alpha Archer: Working Towards Next Generation MGED ====<br />
<br />
Article introducing Archer's core new features that will be "coming" to MGED. Undo, interactive editing, tree view, and info panels come to mind.<br />
<br />
==== Finding the Hot Spots ====<br />
<br />
Article on the rt lighting model Stephen Kennedy developed that visualizes the time spent per-pixel.<br />
<br />
==== Point Clouds ====<br />
<br />
Article introducing the new point cloud primitive.<br />
<br />
==== bn_mat_inv: singular matrix ====<br />
<br />
Article on the v4 format and binary compatibility.<br />
<br />
==== Model Showcase: Goliath ====<br />
<br />
Article talking about the making of the Goliath model.<br />
<br />
==== Model Showcase: Chumaciera ====<br />
<br />
Article on Pedro Baptista's bearing model.<br />
<br />
==== Model Showcase: Proyecto Catapulta ====<br />
<br />
Article on a model developed by André Santos, António Almeida, and Pedro Ferreira.<br />
<br />
==== Model Showcase: Union Coupling Tool ====<br />
<br />
Article on a model developed by Inês de Matos under teacher Luís Ferreira. The project focuses on a tool, union coupling, based on the book, http://purl.pt/14352 , page 122 of the original book and page 128 of the file, figures 108 and 109.<br />
<br />
==== Geometry Service FAQ ====<br />
<br />
FAQ summarization of the GS as it pertains to the wider open source community.<br />
<br />
==== BRL-CAD's 3rd Generation Build System ====<br />
<br />
Article on the new CMake build system.<br />
<br />
==== BRL-CAD's Open Source Vision ====<br />
<br />
Article introducing the Project Priorities diagram and overall project vision.<br />
<br />
==== BRL-CAD Primitives Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's primitives and their current status.<br />
<br />
==== BRL-CAD Geometry Converter Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's geometry converters.<br />
<br />
==== Release Schedule ====<br />
<br />
Explain our release schedule and versioning system.<br />
<br />
==== RTGL ====<br />
<br />
Article on Nick's point-based visualization mode.<br />
<br />
==== BRL-CAD Quick Reference Card ====<br />
<br />
Article on a BRL-CAD QRC similar to the existing MGED QRC.<br />
<br />
==== BRL-CAD Bibliography ====<br />
<br />
After the .bib gets published to the website, an article announcing it and soliciting additions.<br />
<br />
==== Revolve Primitive ====<br />
<br />
Article on Timothy Van Ruitenbeek's work implementing 'revolve'.<br />
<br />
==== Parametrics and Constraints ====<br />
<br />
Article on Dawn Thomas' work to integrate parametric equation and constraint evaluation support.<br />
<br />
==== Converting Implicit to Explicit: CSG to BREP NURBS ====<br />
<br />
Article on the work by Cliff Yapp, Joe Doliner, and Ben Poole converting primitives with an implicit representation into an explicit NURBS representation.<br />
<br />
==== Online Model Repository ====<br />
<br />
Article on Elena Băutu's work developing the model repository website.<br />
<br />
==== Project Statistics for 2010 ====<br />
<br />
Article on our current stats similar to previous years.<br />
<br />
==== Next Generation BRL-CAD ====<br />
<br />
Article on our super secret awesome new GUI.</div>Plussaihttps://brlcad.org/w/index.php?title=Community_Publication_Portal&diff=4595Community Publication Portal2012-11-15T08:41:46Z<p>Plussai: /* For surface tree */</p>
<hr />
<div>Welcome to the BRL-CAD community publication portal. This page is dedicated to the preparation and editing of BRL-CAD announcements. Proposed and upcoming topics are listed. Anyone is '''welcome and encouraged''' to share news about any activity related to BRL-CAD. Community editing and review are encouraged.<br />
<br />
__TOC__<br />
<br />
'''Formatting & Editing Standards:'''<br />
<br />
* Quotations are italicized and placed between double quotes ('' "Like This" '').<br />
<br />
* AA (All Acronyms) need to be defined upon first use, don't abbrev. words.<br />
<br />
* Section headings uppercase the major words and are in bold ('''Like This''')<br />
<br />
* Use the serial comma: one, two, and three; not one, two and three.<br />
<br />
* Cite references, include hyperlinks.<br />
<br />
* Keep it brief.<br />
<br />
'''Distribution Channels:'''<br />
<br />
For release publications, follow [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING HACKING]. For everything else, distribute to the following:<br />
<br />
* brlcad-news@lists.sourceforge.net<br />
* http://brlcad.org/d/node/add/story<br />
* https://sourceforge.net/news/?group_id=105292<br />
* (optional) https://brlcad.org/wiki/<br />
* (optional) http://www.tenlinks.com/NEWS/tl_daily/submit_news.htm<br />
* (optional) http://upfrontezine.com<br />
<br />
----<br />
----<br />
<br />
== Ready for Publication ==<br />
These articles are ready for publication. Release notes should be posted after tarballs, ideally the last or first week of a month. Other publications should be scheduled one or two weeks later, ideally on the second or third week of the month.<br />
<br />
Note: if you see a comment indicating that a section is FROZEN, any changes you make in that section may go unnoticed as the article is being prepared for distribution. If you find errors in a FROZEN article, go ahead and correct the article but contact Sean (brlcad on freenode [[IRC]]) who may be able to incorporate changes during final publication.<br />
<br />
==== Move from Final Review to Here When Ready====<br />
<br />
<br />
----<br />
<br />
== Final Editorial Review ==<br />
These should be "complete" articles. The author is done. All that remains is a structure, grammar, voice, punctuation, and spelling review. Images welcome.<br />
<br />
==== Kyle Bodt: Ronja ====<br />
<br />
http://brlcad.org/wiki/Ronja<br />
<br />
Ronja (Reasonable Optical Near Joint Access) is an innovative piece of equipment that utilizes reliable optical data links to create a current communication range of 1.4 km and a speed of 10Mbps full duplex that can be used as a general purpose wireless link for virtually any networking project. This is a very important project for Twibright Labs, a small group of computer science graduate students operating out of Charles University in Prague in the Czech Republic. The group specializes in the usage of Free Software and User Controlled Technology Development.<br />
<br />
The primary output for the Ronja project is a design. The lab does not intend to manufacture and sell the hardware that is being designed but wants to engage in open source development of the technology. The philosophy surrounding User Controlled Technology is the ideal that the end-user is provided with unrestricted access to the intellectual property surrounding the technology, including the tools that are being used to create it. One tool playing an integral part in the development of the Ronja designs is BRL-CAD. All of the models that Twibright labs use to display the different variants of their Ronja concept were created with the help of BRL-CAD. BRL-CAD has allowed the members of Twibright labs to create instructional diagrams so that the users and builders of their open source technology will be able to have the latest information with regard to the proper construction of a Ronja unit. The interactive geometry editor and ray-tracers in BRL-CAD are an integral part in the communication of design plans for Twibright labs and enables them to connect with the users, who are the driving force behind the User Controlled Technology ideal.<br />
<br />
----<br />
<br />
== Initial Drafts ==<br />
These are incomplete articles being worked on. Short 250 to 500-word articles (not counting tables, images, etc) are usually perfect.<br />
<br />
==== Anurag Murty: Voxelizing Geometry ====<br />
Given a set of primitives as input, the voxelize command uses the data obtained from BRL-CAD's raytracer to represent the input in the form of voxels(Volumetric Picture Elements). A uniform grid of rays is uniformly shot on the given input and an approximation of the volume filled in each voxel region is made from the raytracing data. Depending on the approximate volume of the voxel filled, a voxel is classified as IN or OUT of the voxelized output. The voxels are represented as RPPs. <br />
Such voxelized outputs have applications in Volumetric rendering and finite element analysis.<br />
<br />
SYNTAX : <br />
voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]<br />
<br />
ARGUMENTS-<br />
<br />
-d - Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values<br />
<br />
-s - Specifies the voxel size in each direction. <br />
<br />
-t - Specifies the threshold volume to decide if voxel is to be included in the voxelized output. <br />
<br />
new_obj - Name for resultant primitive that is a region containing the resulting voxels. <br />
<br />
old_obj - Name of source primitive or collection.<br />
<br />
<br />
NOTES- <br />
<br />
1. A greater level of detail usually implies a much better approximation of fill volumes at the cost of more computations.<br />
<br />
2. Lesser voxel sizes give a more precise representation of the input at the cost of more memory requirements.<br />
<br />
3. Threshold value (the argument of -t) should be a value between 0 and 1, and not a percentage.<br />
<br />
==== Cristina Precup: Visualizing Directed Acyclic Graphs ====<br />
'''Visualizing Constructive Solid Geometry''' is a project meant to illustrate in an intuitive and interactive manner the hierarchical structure of .g geometry databases.<br />
<br />
For the representation of the hierarchies, the '''Adaptagrams''' graph library has been used. This made possible organizing the objects contained within the database into directed acyclic graphs.<br />
<br />
Following, are the steps that have been taken in developing the graph layout API:<br />
<br />
* Integrate the Adaptagrams library into BRL-CAD.<br />
* Traverse the geometry database and distinguish different types of objects (''primitive'', ''combination'', ''non-geometry'') within it, as well as, establish the operations between them (''union'', ''difference'', ...). Add all this data to the graph structure constructed with Adaptagrams.<br />
* Display the objects using a Tk Canvas widget inside a window.<br />
* Develop a ''decorative routine'' that sets different colors for different types of objects, correspondingly.<br />
* Create a name label for each represented object.<br />
* Develop a layout algorithm that aligns the nodes of the graph in a hierarchical way.<br />
* Introduce the '''graph''' command in both '''MGED''' and '''Archer'''. It has two subcommands:<br />
** '''show''' which displays a list with the name and type of the objects along with the nodes' and edges' positions;<br />
** '''positions''' that lists the names, types and positions of the corresponding nodes within the graph;<br />
* Introduce the '''igraph''' command in both MGED and Archer. This command pops up a graph based visualization window of the currently opened .g database. Its documentation can be found in ''brlman''.<br />
<br />
As an example, here is how the graph for the ''share/db/axis.g'' database looks like now:<br />
:[[Image:Graph_editor_v2.png]]<br />
<br />
Further work that can extend the ''interactive'' trait of the graph layout API includes adding user actions upon the graph such as ''move'' (dragging a node) or ''delete'' functionalities.<br />
<br />
==== Ksenija Slivko: Reducing Code ====<br />
<br />
===== Abstract =====<br />
The main aim of this project was to decrease the number of lines of code in the project. Since the project is being developing for quite a long time there were many "copy-pastes". They were redacted. <br />
<br />
===== The process of developing =====<br />
Coding period can be divided into three parts:<br />
* reduction in the single files<br />
* reduction in different files in the single program or library<br />
* reduction in different libraries<br />
<br />
===== Improving =====<br />
Since the project is quite large the redaction can be continued<br />
<br />
==== Laijiren: NURBS Tessellation: What, Why, How? ====<br />
===== Abstract =====<br />
Non-Uniform Rational B-Spline surfaces are widely used in CAD system. But they are not suitable for direct visualization on modern GPU systems. Today’s graphics hardware supports the high-speed display of polygonal objects consisting of triangles. This means that analytical surfaces (like NURBS) need to be triangulated so they can be displayed by 3D graphics cards.<br />
<br />
===== Main work =====<br />
===== For debugging tool =====<br />
*add 'info TB' 'info SB' to display information of piecewise bezier trim curve<br />
*add 'info T' 'info E' to display information of trim curve in parameter region and edge in 3d region<br />
*add 'plot SCV' to display control point net and 'plot TESS' to display the result of tessellation<br />
<br />
===== For surface tree =====<br />
*subdivide a Nurbs surface in a adaptive method and a new recursion termination condition for surface subdivision.<br />
reference:NURBS rendering in OpenSG Plus<br />
*implement the doTrimming function in Surface tree.<br />
1)compute the intersection between trim curve and rect's edge of sub-surface in parameter region<br />
<br />
2)implement a trimLoop class to get the valid loop and the trimmed loop<br />
<br />
3)triangulate the valid loop in form of polygon<br />
<br />
==== Suryajith Chillara: Benchmark Performance Database ====<br />
===== Abstract =====<br />
The main idea is to store the data both in the database and the log files stored in the archive. The storage in the database enables the content to be searched via the parameters such as machine descriptions, versions, results and could be compared. The storage as a file in the archive is to maintain a back up of the file and whenever a developer needs a specific bunch of benchmark logs, he could get them from the archive with or without the help of the database.<br />
<br />
===== Main Components =====<br />
* '''Log Parser :''' The data of the log file needs to be parsed and the relevant and important information has to be logged in the database so as to make the data access for the graphic display through the frontend could be made possible. <br />
* '''Web API :''' Implemented via the bottle framework so as to submit the logs from the brlcad installation via scripts.<br />
* '''Web backend :''' A backend has been implemented as a MVC framework from scratch using the python bottle framework. <br />
* '''Frontend :''' The website that can offer multiple mechanisms for adding new performance run data into the database and provide multiple graphical and non-graphical visualizations of aggregate performance data (i.e., graphs, charts, tables, etc). Graphs, tables and charts are generated with the help of Google Charts via wrapper which generates the javascript code to interact with the Google Charts service.<br />
[[Image:Absavgperfvsimagescomb.png]]<br />
<br />
<br />
Plumbing between these components is via the python scripts. <br />
<br />
<br />
===== Tool & Service dependancies =====<br />
* Python 2.7 and libraries<br />
* Bottle web framework<br />
* MySQL<br />
* Google Charts<br />
<br />
==== Wu Jianbang: NURBS surface-surface intersections ====<br />
I focused on the "NURBS surface-surface intersections" project after the mid-term evaluation of this year's GSoC, before which I worked on converting implicit primitives to NURBS B-rep forms.<br />
<br />
The function calculating NURBS surface-surface intersection curves is surface_surface_intersection() which is declared in include/nurbs.h and implemented in src/libnurbs/opennurbs_ext.cpp. It outputs intersection curves in 3d space and in both surfaces' UV parameter spaces.<br />
<br />
The approach of the algorithm originates from:<br />
<br />
Adarsh Krishnamurthy, Rahul Khardekar, Sara McMains, Kirk Haller, and Gershon Elber. 2008. Performing efficient NURBS modeling operations on the GPU. In Proceedings of the 2008 ACM symposium on Solid and physical modeling (SPM '08). ACM, New York, NY, USA, 257-268. DOI=10.1145/1364901.1364937 http://doi.acm.org/10.1145/1364901.1364937<br />
<br />
It can be divided into several steps:<br />
<br />
* Generate the bounding box of the two surfaces.<br />
* If their bounding boxes intersect:<br />
** Split the two surfaces, both into four parts, and calculate the sub-surfaces' bounding boxes<br />
** Calculate the intersection of sub-surfaces' bboxes, if they do intersect, go deeper with splitting surfaces and smaller bboxes, otherwise trace back.<br />
* After getting the intersecting bboxes, approximate the surface inside the bbox with two triangles, and calculate the intersection points of the triangles (both in 3d space and two surfaces' UV space)<br />
* Fit the intersection points into polyline curves, and then to NURBS curves. Points with distance less than max_dis are considered in one curve.<br />
<br />
It needs to be mentioned here that the value max_dis can be provided by the user or generated automatically.<br />
<br />
Besides, after calculating the intersection curves, the next steps towords evaluated NURBS are splitting the surfaces into sub-surfaces with the intersection curves as their boundaries, and some inside-outside tests to decide which sub-surfaces should be included in the final object. Some work on splitting has been done, generating some b-rep faces that can pass IsValid(), but still further work is needed.<br />
<br />
==== Andrei Popescu: Network Performance Testing ====<br />
<br />
The project that I have been working on during the summer, as part of the Google Summer of Code program,<br> can be broken down into three independent parts and it consisted in running various tests for the BRL-CAD<br> networking library(Libpkg) .<br />
<br />
*Speed testing and investigations to uncover any potential performance bottleneck.<br />
*Unit tests and code review to find and cover any untreated exceptions(crashes) in the Libpkg library.<br />
*Eliminate the assumption of globals in the API.<br />
<br />
For the first part, I have run two types of tests : <br><br />
<br />
Local ones, both the "sender" and the "receiver" were located on localhost.<br />
The script gathered data<br> regarding the transmission speed for each set of package sizes (Here, package refers to the package <br>created by networking library, not networking packages) respectively file sizes.<br />
<br />
Remote ones, where the "sender" and the "receiver" were on separate machines, connected using SSH.<br> The script ran and the data gathered was done in the same way as the localhost one.Using the data <br> obtained from the tests, two 3D graphs were drawn.However, the tests were inconclusive, I could not find<br> an "ideal" package size to use regardless of file size.<br />
<br />
After Mid-term I focused mostly on second part. I used test units from libbu(Utility library) as an example<br> for the unit test type and design.<br />
When the mentioned tests were run, several exceptions that caused<br> crashes were discovered. Lastly, I have written fixes for the discovered crashes.<br />
<br />
The third part of the project has not been covered yet, so more work is needed.Although, I am doing my<br> best to finish it in the following weeks.<br />
<br />
==== Chris Dueck: Calculating 2D Sketch Surface Area ====<br />
<br />
Calculating the surface area of a 2D Sketch primitive is not a trivial task. Sketches are created interactively by the user, and can contain straight line segments, circular arc segments (and full circles), as well as Bezier and NURBS curves.<br />
<br />
The method used to approximately compute the area of a 2D sketch is as follows:<br />
<br />
*1.) Approximate the sketch by a polygon<br />
*2.) Compute the area of the polygon exactly using Green's Theorem<br />
*3.) Add the areas of any circular arc segments that were created during (1)<br />
<br />
To approximate the sketch by a polygon, each possible curve type of a sketch must be considered.<br />
<br />
*If the curve is a straight line, it need not be approximated.<br />
<br />
*If the curve is a circular arc, it must be determined if it is a full circle (in which case its area can be computed easily) or if it is a circular arc segment. If it is a circular arc segment, the line segment from the beginning of the arc to the endpoint is added to the polygon, and the excess area of the circular arc segment itself can be calculated easily (https://en.wikipedia.org/wiki/Circular_segment)<br />
<br />
*If the curve is a Bezier curve, it can be approximated by a series of circular arcs. The algorithm used can be found here (http://itc.ktu.lt/itc354/Riskus354.pdf). The algorithm recursively subdivides the Bezier until it is approximated to tolerance by a biarc and uses the curvature value of the Bezier at a point to determine the depth of subdivision. Then each circular arc in the approximation of the Bezier curve is treated as above.<br />
<br />
Finally, the area of the polygon can be efficiently calculated using Green's Theorem (http://www.softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#3D%20Standard%20Formula) using cross products.<br />
<br />
==== Cliff Yapp: NURBS Ray Tracing in BRL-CAD ====<br />
<br />
Over the past year, an intense development effort by BRL-CAD's development team has successfully implemented raytracing of Non-Uniform Rational BSpline (NURBS) geometry within the BRL-CAD Computer-Aided Design (CAD) package. NURBS surfaces are very general, very complex mathematical shapes used by virtually all modern commercial CAD software packages. Because BRL-CAD did not originally support this type of geometry, commercial models could only be imported into BRL-CAD after a labor-intensive and difficult conversion process from NURBS form to triangle-base geometry (referred to in BRL-CAD as Bags-of-Triangles or BoTs). The new NURBS raytracing capability builds on work by many developers over a period of years, who in turn built on the open source library OpenNURBS. Support for this primitive type means BRL-CAD can now store and raytrace data from commercial models without requiring preliminary conversion to another type of geometry.<br />
<br />
The last major feature needed to make import of commercial models in BRL-CAD straightforward is conversion support for ISO’s "Standard for the Exchange of Product model data" or STEP file format. STEP uses NURBS geometry in its definition, making support for NURBS geometry a necessary prelude to support for STEP import. Most commercial CAD modelers support this file format as an output option, hence STEP support in BRL-CAD would allow a direct path for moving geometric descriptions from a variety of commercial modelers to BRL-CAD. Considerable progress has already been made on STEP import support, but more work is need to bring the code and feature set to "production quality". If anyone would like to join the BRL-CAD open source development effort and has a little familiarity with C++, the step-g converter and its supporting libraries have some simple-yet-useful tasks that would be an excellent and very useful way to explore the project - join BRL-CAD's IRC channel or development email list if you are interested!<br />
<br />
==== Erik Greenwald: Bolting ADRT's libtie under the hood ====<br />
<br />
[[Image:BoTvsTie.png|right|thumb|256px|BoT vs Tie pixdiff]]<br />
<br />
Initial progress on the integration of ADRT's libtie "triangle intersection engine" with LIBRT.<br />
<br />
----<br />
<br />
== Idea Hopper ==<br />
These are ideas for interesting or useful publications. We need someone to at least write a draft.<br />
<br />
==== BRL-CAD's Evolutionary API ====<br />
<br />
Talk about BRL-CAD deprecation process.<br />
<br />
==== Introduction to new .deb and .rpm builds ====<br />
<br />
Brief article overviewing the efforts by jordisayol for Debian, Ubuntu, Fedora, and openSUSE. Included are new icons, menu items, mime type associations, and more.<br />
<br />
==== 2010 End Of Year Review ====<br />
<br />
Article giving an overview of the past year's highlight developments with hints at what 2011 may bring. Alternatively, may be the annual statistics review if we switch from fiscal to calendar year reporting.<br />
<br />
==== Erik Greenwald: ADRT/ISST Visualization ====<br />
<br />
Article introducing ADRT/ISST core capability.<br />
<br />
==== Bob Parker: Alpha Archer: Working Towards Next Generation MGED ====<br />
<br />
Article introducing Archer's core new features that will be "coming" to MGED. Undo, interactive editing, tree view, and info panels come to mind.<br />
<br />
==== Finding the Hot Spots ====<br />
<br />
Article on the rt lighting model Stephen Kennedy developed that visualizes the time spent per-pixel.<br />
<br />
==== Point Clouds ====<br />
<br />
Article introducing the new point cloud primitive.<br />
<br />
==== bn_mat_inv: singular matrix ====<br />
<br />
Article on the v4 format and binary compatibility.<br />
<br />
==== Model Showcase: Goliath ====<br />
<br />
Article talking about the making of the Goliath model.<br />
<br />
==== Model Showcase: Chumaciera ====<br />
<br />
Article on Pedro Baptista's bearing model.<br />
<br />
==== Model Showcase: Proyecto Catapulta ====<br />
<br />
Article on a model developed by André Santos, António Almeida, and Pedro Ferreira.<br />
<br />
==== Model Showcase: Union Coupling Tool ====<br />
<br />
Article on a model developed by Inês de Matos under teacher Luís Ferreira. The project focuses on a tool, union coupling, based on the book, http://purl.pt/14352 , page 122 of the original book and page 128 of the file, figures 108 and 109.<br />
<br />
==== Geometry Service FAQ ====<br />
<br />
FAQ summarization of the GS as it pertains to the wider open source community.<br />
<br />
==== BRL-CAD's 3rd Generation Build System ====<br />
<br />
Article on the new CMake build system.<br />
<br />
==== BRL-CAD's Open Source Vision ====<br />
<br />
Article introducing the Project Priorities diagram and overall project vision.<br />
<br />
==== BRL-CAD Primitives Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's primitives and their current status.<br />
<br />
==== BRL-CAD Geometry Converter Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's geometry converters.<br />
<br />
==== Release Schedule ====<br />
<br />
Explain our release schedule and versioning system.<br />
<br />
==== RTGL ====<br />
<br />
Article on Nick's point-based visualization mode.<br />
<br />
==== BRL-CAD Quick Reference Card ====<br />
<br />
Article on a BRL-CAD QRC similar to the existing MGED QRC.<br />
<br />
==== BRL-CAD Bibliography ====<br />
<br />
After the .bib gets published to the website, an article announcing it and soliciting additions.<br />
<br />
==== Revolve Primitive ====<br />
<br />
Article on Timothy Van Ruitenbeek's work implementing 'revolve'.<br />
<br />
==== Parametrics and Constraints ====<br />
<br />
Article on Dawn Thomas' work to integrate parametric equation and constraint evaluation support.<br />
<br />
==== Converting Implicit to Explicit: CSG to BREP NURBS ====<br />
<br />
Article on the work by Cliff Yapp, Joe Doliner, and Ben Poole converting primitives with an implicit representation into an explicit NURBS representation.<br />
<br />
==== Online Model Repository ====<br />
<br />
Article on Elena Băutu's work developing the model repository website.<br />
<br />
==== Project Statistics for 2010 ====<br />
<br />
Article on our current stats similar to previous years.<br />
<br />
==== Next Generation BRL-CAD ====<br />
<br />
Article on our super secret awesome new GUI.</div>Plussaihttps://brlcad.org/w/index.php?title=Community_Publication_Portal&diff=4594Community Publication Portal2012-11-15T08:41:27Z<p>Plussai: /* For surface tree */</p>
<hr />
<div>Welcome to the BRL-CAD community publication portal. This page is dedicated to the preparation and editing of BRL-CAD announcements. Proposed and upcoming topics are listed. Anyone is '''welcome and encouraged''' to share news about any activity related to BRL-CAD. Community editing and review are encouraged.<br />
<br />
__TOC__<br />
<br />
'''Formatting & Editing Standards:'''<br />
<br />
* Quotations are italicized and placed between double quotes ('' "Like This" '').<br />
<br />
* AA (All Acronyms) need to be defined upon first use, don't abbrev. words.<br />
<br />
* Section headings uppercase the major words and are in bold ('''Like This''')<br />
<br />
* Use the serial comma: one, two, and three; not one, two and three.<br />
<br />
* Cite references, include hyperlinks.<br />
<br />
* Keep it brief.<br />
<br />
'''Distribution Channels:'''<br />
<br />
For release publications, follow [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING HACKING]. For everything else, distribute to the following:<br />
<br />
* brlcad-news@lists.sourceforge.net<br />
* http://brlcad.org/d/node/add/story<br />
* https://sourceforge.net/news/?group_id=105292<br />
* (optional) https://brlcad.org/wiki/<br />
* (optional) http://www.tenlinks.com/NEWS/tl_daily/submit_news.htm<br />
* (optional) http://upfrontezine.com<br />
<br />
----<br />
----<br />
<br />
== Ready for Publication ==<br />
These articles are ready for publication. Release notes should be posted after tarballs, ideally the last or first week of a month. Other publications should be scheduled one or two weeks later, ideally on the second or third week of the month.<br />
<br />
Note: if you see a comment indicating that a section is FROZEN, any changes you make in that section may go unnoticed as the article is being prepared for distribution. If you find errors in a FROZEN article, go ahead and correct the article but contact Sean (brlcad on freenode [[IRC]]) who may be able to incorporate changes during final publication.<br />
<br />
==== Move from Final Review to Here When Ready====<br />
<br />
<br />
----<br />
<br />
== Final Editorial Review ==<br />
These should be "complete" articles. The author is done. All that remains is a structure, grammar, voice, punctuation, and spelling review. Images welcome.<br />
<br />
==== Kyle Bodt: Ronja ====<br />
<br />
http://brlcad.org/wiki/Ronja<br />
<br />
Ronja (Reasonable Optical Near Joint Access) is an innovative piece of equipment that utilizes reliable optical data links to create a current communication range of 1.4 km and a speed of 10Mbps full duplex that can be used as a general purpose wireless link for virtually any networking project. This is a very important project for Twibright Labs, a small group of computer science graduate students operating out of Charles University in Prague in the Czech Republic. The group specializes in the usage of Free Software and User Controlled Technology Development.<br />
<br />
The primary output for the Ronja project is a design. The lab does not intend to manufacture and sell the hardware that is being designed but wants to engage in open source development of the technology. The philosophy surrounding User Controlled Technology is the ideal that the end-user is provided with unrestricted access to the intellectual property surrounding the technology, including the tools that are being used to create it. One tool playing an integral part in the development of the Ronja designs is BRL-CAD. All of the models that Twibright labs use to display the different variants of their Ronja concept were created with the help of BRL-CAD. BRL-CAD has allowed the members of Twibright labs to create instructional diagrams so that the users and builders of their open source technology will be able to have the latest information with regard to the proper construction of a Ronja unit. The interactive geometry editor and ray-tracers in BRL-CAD are an integral part in the communication of design plans for Twibright labs and enables them to connect with the users, who are the driving force behind the User Controlled Technology ideal.<br />
<br />
----<br />
<br />
== Initial Drafts ==<br />
These are incomplete articles being worked on. Short 250 to 500-word articles (not counting tables, images, etc) are usually perfect.<br />
<br />
==== Anurag Murty: Voxelizing Geometry ====<br />
Given a set of primitives as input, the voxelize command uses the data obtained from BRL-CAD's raytracer to represent the input in the form of voxels(Volumetric Picture Elements). A uniform grid of rays is uniformly shot on the given input and an approximation of the volume filled in each voxel region is made from the raytracing data. Depending on the approximate volume of the voxel filled, a voxel is classified as IN or OUT of the voxelized output. The voxels are represented as RPPs. <br />
Such voxelized outputs have applications in Volumetric rendering and finite element analysis.<br />
<br />
SYNTAX : <br />
voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]<br />
<br />
ARGUMENTS-<br />
<br />
-d - Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values<br />
<br />
-s - Specifies the voxel size in each direction. <br />
<br />
-t - Specifies the threshold volume to decide if voxel is to be included in the voxelized output. <br />
<br />
new_obj - Name for resultant primitive that is a region containing the resulting voxels. <br />
<br />
old_obj - Name of source primitive or collection.<br />
<br />
<br />
NOTES- <br />
<br />
1. A greater level of detail usually implies a much better approximation of fill volumes at the cost of more computations.<br />
<br />
2. Lesser voxel sizes give a more precise representation of the input at the cost of more memory requirements.<br />
<br />
3. Threshold value (the argument of -t) should be a value between 0 and 1, and not a percentage.<br />
<br />
==== Cristina Precup: Visualizing Directed Acyclic Graphs ====<br />
'''Visualizing Constructive Solid Geometry''' is a project meant to illustrate in an intuitive and interactive manner the hierarchical structure of .g geometry databases.<br />
<br />
For the representation of the hierarchies, the '''Adaptagrams''' graph library has been used. This made possible organizing the objects contained within the database into directed acyclic graphs.<br />
<br />
Following, are the steps that have been taken in developing the graph layout API:<br />
<br />
* Integrate the Adaptagrams library into BRL-CAD.<br />
* Traverse the geometry database and distinguish different types of objects (''primitive'', ''combination'', ''non-geometry'') within it, as well as, establish the operations between them (''union'', ''difference'', ...). Add all this data to the graph structure constructed with Adaptagrams.<br />
* Display the objects using a Tk Canvas widget inside a window.<br />
* Develop a ''decorative routine'' that sets different colors for different types of objects, correspondingly.<br />
* Create a name label for each represented object.<br />
* Develop a layout algorithm that aligns the nodes of the graph in a hierarchical way.<br />
* Introduce the '''graph''' command in both '''MGED''' and '''Archer'''. It has two subcommands:<br />
** '''show''' which displays a list with the name and type of the objects along with the nodes' and edges' positions;<br />
** '''positions''' that lists the names, types and positions of the corresponding nodes within the graph;<br />
* Introduce the '''igraph''' command in both MGED and Archer. This command pops up a graph based visualization window of the currently opened .g database. Its documentation can be found in ''brlman''.<br />
<br />
As an example, here is how the graph for the ''share/db/axis.g'' database looks like now:<br />
:[[Image:Graph_editor_v2.png]]<br />
<br />
Further work that can extend the ''interactive'' trait of the graph layout API includes adding user actions upon the graph such as ''move'' (dragging a node) or ''delete'' functionalities.<br />
<br />
==== Ksenija Slivko: Reducing Code ====<br />
<br />
===== Abstract =====<br />
The main aim of this project was to decrease the number of lines of code in the project. Since the project is being developing for quite a long time there were many "copy-pastes". They were redacted. <br />
<br />
===== The process of developing =====<br />
Coding period can be divided into three parts:<br />
* reduction in the single files<br />
* reduction in different files in the single program or library<br />
* reduction in different libraries<br />
<br />
===== Improving =====<br />
Since the project is quite large the redaction can be continued<br />
<br />
==== Laijiren: NURBS Tessellation: What, Why, How? ====<br />
===== Abstract =====<br />
Non-Uniform Rational B-Spline surfaces are widely used in CAD system. But they are not suitable for direct visualization on modern GPU systems. Today’s graphics hardware supports the high-speed display of polygonal objects consisting of triangles. This means that analytical surfaces (like NURBS) need to be triangulated so they can be displayed by 3D graphics cards.<br />
<br />
===== Main work =====<br />
===== For debugging tool =====<br />
*add 'info TB' 'info SB' to display information of piecewise bezier trim curve<br />
*add 'info T' 'info E' to display information of trim curve in parameter region and edge in 3d region<br />
*add 'plot SCV' to display control point net and 'plot TESS' to display the result of tessellation<br />
<br />
===== For surface tree =====<br />
*subdivide a Nurbs surface in a adaptive method and a new recursion termination condition for surface subdivision.<br />
reference:NURBS rendering in OpenSG Plus<br />
*implement the doTrimming function in Surface tree.<br />
1)compute the intersection between trim curve and rect's edge of sub-surface in parameter region<br />
<br />
2)implement a trimLoop class to get the valid loop and the trimmed loop<br />
<br />
3)triangulate the valid loop in form of polygon<br />
<br />
==== Suryajith Chillara: Benchmark Performance Database ====<br />
===== Abstract =====<br />
The main idea is to store the data both in the database and the log files stored in the archive. The storage in the database enables the content to be searched via the parameters such as machine descriptions, versions, results and could be compared. The storage as a file in the archive is to maintain a back up of the file and whenever a developer needs a specific bunch of benchmark logs, he could get them from the archive with or without the help of the database.<br />
<br />
===== Main Components =====<br />
* '''Log Parser :''' The data of the log file needs to be parsed and the relevant and important information has to be logged in the database so as to make the data access for the graphic display through the frontend could be made possible. <br />
* '''Web API :''' Implemented via the bottle framework so as to submit the logs from the brlcad installation via scripts.<br />
* '''Web backend :''' A backend has been implemented as a MVC framework from scratch using the python bottle framework. <br />
* '''Frontend :''' The website that can offer multiple mechanisms for adding new performance run data into the database and provide multiple graphical and non-graphical visualizations of aggregate performance data (i.e., graphs, charts, tables, etc). Graphs, tables and charts are generated with the help of Google Charts via wrapper which generates the javascript code to interact with the Google Charts service.<br />
[[Image:Absavgperfvsimagescomb.png]]<br />
<br />
<br />
Plumbing between these components is via the python scripts. <br />
<br />
<br />
===== Tool & Service dependancies =====<br />
* Python 2.7 and libraries<br />
* Bottle web framework<br />
* MySQL<br />
* Google Charts<br />
<br />
==== Wu Jianbang: NURBS surface-surface intersections ====<br />
I focused on the "NURBS surface-surface intersections" project after the mid-term evaluation of this year's GSoC, before which I worked on converting implicit primitives to NURBS B-rep forms.<br />
<br />
The function calculating NURBS surface-surface intersection curves is surface_surface_intersection() which is declared in include/nurbs.h and implemented in src/libnurbs/opennurbs_ext.cpp. It outputs intersection curves in 3d space and in both surfaces' UV parameter spaces.<br />
<br />
The approach of the algorithm originates from:<br />
<br />
Adarsh Krishnamurthy, Rahul Khardekar, Sara McMains, Kirk Haller, and Gershon Elber. 2008. Performing efficient NURBS modeling operations on the GPU. In Proceedings of the 2008 ACM symposium on Solid and physical modeling (SPM '08). ACM, New York, NY, USA, 257-268. DOI=10.1145/1364901.1364937 http://doi.acm.org/10.1145/1364901.1364937<br />
<br />
It can be divided into several steps:<br />
<br />
* Generate the bounding box of the two surfaces.<br />
* If their bounding boxes intersect:<br />
** Split the two surfaces, both into four parts, and calculate the sub-surfaces' bounding boxes<br />
** Calculate the intersection of sub-surfaces' bboxes, if they do intersect, go deeper with splitting surfaces and smaller bboxes, otherwise trace back.<br />
* After getting the intersecting bboxes, approximate the surface inside the bbox with two triangles, and calculate the intersection points of the triangles (both in 3d space and two surfaces' UV space)<br />
* Fit the intersection points into polyline curves, and then to NURBS curves. Points with distance less than max_dis are considered in one curve.<br />
<br />
It needs to be mentioned here that the value max_dis can be provided by the user or generated automatically.<br />
<br />
Besides, after calculating the intersection curves, the next steps towords evaluated NURBS are splitting the surfaces into sub-surfaces with the intersection curves as their boundaries, and some inside-outside tests to decide which sub-surfaces should be included in the final object. Some work on splitting has been done, generating some b-rep faces that can pass IsValid(), but still further work is needed.<br />
<br />
==== Andrei Popescu: Network Performance Testing ====<br />
<br />
The project that I have been working on during the summer, as part of the Google Summer of Code program,<br> can be broken down into three independent parts and it consisted in running various tests for the BRL-CAD<br> networking library(Libpkg) .<br />
<br />
*Speed testing and investigations to uncover any potential performance bottleneck.<br />
*Unit tests and code review to find and cover any untreated exceptions(crashes) in the Libpkg library.<br />
*Eliminate the assumption of globals in the API.<br />
<br />
For the first part, I have run two types of tests : <br><br />
<br />
Local ones, both the "sender" and the "receiver" were located on localhost.<br />
The script gathered data<br> regarding the transmission speed for each set of package sizes (Here, package refers to the package <br>created by networking library, not networking packages) respectively file sizes.<br />
<br />
Remote ones, where the "sender" and the "receiver" were on separate machines, connected using SSH.<br> The script ran and the data gathered was done in the same way as the localhost one.Using the data <br> obtained from the tests, two 3D graphs were drawn.However, the tests were inconclusive, I could not find<br> an "ideal" package size to use regardless of file size.<br />
<br />
After Mid-term I focused mostly on second part. I used test units from libbu(Utility library) as an example<br> for the unit test type and design.<br />
When the mentioned tests were run, several exceptions that caused<br> crashes were discovered. Lastly, I have written fixes for the discovered crashes.<br />
<br />
The third part of the project has not been covered yet, so more work is needed.Although, I am doing my<br> best to finish it in the following weeks.<br />
<br />
==== Chris Dueck: Calculating 2D Sketch Surface Area ====<br />
<br />
Calculating the surface area of a 2D Sketch primitive is not a trivial task. Sketches are created interactively by the user, and can contain straight line segments, circular arc segments (and full circles), as well as Bezier and NURBS curves.<br />
<br />
The method used to approximately compute the area of a 2D sketch is as follows:<br />
<br />
*1.) Approximate the sketch by a polygon<br />
*2.) Compute the area of the polygon exactly using Green's Theorem<br />
*3.) Add the areas of any circular arc segments that were created during (1)<br />
<br />
To approximate the sketch by a polygon, each possible curve type of a sketch must be considered.<br />
<br />
*If the curve is a straight line, it need not be approximated.<br />
<br />
*If the curve is a circular arc, it must be determined if it is a full circle (in which case its area can be computed easily) or if it is a circular arc segment. If it is a circular arc segment, the line segment from the beginning of the arc to the endpoint is added to the polygon, and the excess area of the circular arc segment itself can be calculated easily (https://en.wikipedia.org/wiki/Circular_segment)<br />
<br />
*If the curve is a Bezier curve, it can be approximated by a series of circular arcs. The algorithm used can be found here (http://itc.ktu.lt/itc354/Riskus354.pdf). The algorithm recursively subdivides the Bezier until it is approximated to tolerance by a biarc and uses the curvature value of the Bezier at a point to determine the depth of subdivision. Then each circular arc in the approximation of the Bezier curve is treated as above.<br />
<br />
Finally, the area of the polygon can be efficiently calculated using Green's Theorem (http://www.softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#3D%20Standard%20Formula) using cross products.<br />
<br />
==== Cliff Yapp: NURBS Ray Tracing in BRL-CAD ====<br />
<br />
Over the past year, an intense development effort by BRL-CAD's development team has successfully implemented raytracing of Non-Uniform Rational BSpline (NURBS) geometry within the BRL-CAD Computer-Aided Design (CAD) package. NURBS surfaces are very general, very complex mathematical shapes used by virtually all modern commercial CAD software packages. Because BRL-CAD did not originally support this type of geometry, commercial models could only be imported into BRL-CAD after a labor-intensive and difficult conversion process from NURBS form to triangle-base geometry (referred to in BRL-CAD as Bags-of-Triangles or BoTs). The new NURBS raytracing capability builds on work by many developers over a period of years, who in turn built on the open source library OpenNURBS. Support for this primitive type means BRL-CAD can now store and raytrace data from commercial models without requiring preliminary conversion to another type of geometry.<br />
<br />
The last major feature needed to make import of commercial models in BRL-CAD straightforward is conversion support for ISO’s "Standard for the Exchange of Product model data" or STEP file format. STEP uses NURBS geometry in its definition, making support for NURBS geometry a necessary prelude to support for STEP import. Most commercial CAD modelers support this file format as an output option, hence STEP support in BRL-CAD would allow a direct path for moving geometric descriptions from a variety of commercial modelers to BRL-CAD. Considerable progress has already been made on STEP import support, but more work is need to bring the code and feature set to "production quality". If anyone would like to join the BRL-CAD open source development effort and has a little familiarity with C++, the step-g converter and its supporting libraries have some simple-yet-useful tasks that would be an excellent and very useful way to explore the project - join BRL-CAD's IRC channel or development email list if you are interested!<br />
<br />
==== Erik Greenwald: Bolting ADRT's libtie under the hood ====<br />
<br />
[[Image:BoTvsTie.png|right|thumb|256px|BoT vs Tie pixdiff]]<br />
<br />
Initial progress on the integration of ADRT's libtie "triangle intersection engine" with LIBRT.<br />
<br />
----<br />
<br />
== Idea Hopper ==<br />
These are ideas for interesting or useful publications. We need someone to at least write a draft.<br />
<br />
==== BRL-CAD's Evolutionary API ====<br />
<br />
Talk about BRL-CAD deprecation process.<br />
<br />
==== Introduction to new .deb and .rpm builds ====<br />
<br />
Brief article overviewing the efforts by jordisayol for Debian, Ubuntu, Fedora, and openSUSE. Included are new icons, menu items, mime type associations, and more.<br />
<br />
==== 2010 End Of Year Review ====<br />
<br />
Article giving an overview of the past year's highlight developments with hints at what 2011 may bring. Alternatively, may be the annual statistics review if we switch from fiscal to calendar year reporting.<br />
<br />
==== Erik Greenwald: ADRT/ISST Visualization ====<br />
<br />
Article introducing ADRT/ISST core capability.<br />
<br />
==== Bob Parker: Alpha Archer: Working Towards Next Generation MGED ====<br />
<br />
Article introducing Archer's core new features that will be "coming" to MGED. Undo, interactive editing, tree view, and info panels come to mind.<br />
<br />
==== Finding the Hot Spots ====<br />
<br />
Article on the rt lighting model Stephen Kennedy developed that visualizes the time spent per-pixel.<br />
<br />
==== Point Clouds ====<br />
<br />
Article introducing the new point cloud primitive.<br />
<br />
==== bn_mat_inv: singular matrix ====<br />
<br />
Article on the v4 format and binary compatibility.<br />
<br />
==== Model Showcase: Goliath ====<br />
<br />
Article talking about the making of the Goliath model.<br />
<br />
==== Model Showcase: Chumaciera ====<br />
<br />
Article on Pedro Baptista's bearing model.<br />
<br />
==== Model Showcase: Proyecto Catapulta ====<br />
<br />
Article on a model developed by André Santos, António Almeida, and Pedro Ferreira.<br />
<br />
==== Model Showcase: Union Coupling Tool ====<br />
<br />
Article on a model developed by Inês de Matos under teacher Luís Ferreira. The project focuses on a tool, union coupling, based on the book, http://purl.pt/14352 , page 122 of the original book and page 128 of the file, figures 108 and 109.<br />
<br />
==== Geometry Service FAQ ====<br />
<br />
FAQ summarization of the GS as it pertains to the wider open source community.<br />
<br />
==== BRL-CAD's 3rd Generation Build System ====<br />
<br />
Article on the new CMake build system.<br />
<br />
==== BRL-CAD's Open Source Vision ====<br />
<br />
Article introducing the Project Priorities diagram and overall project vision.<br />
<br />
==== BRL-CAD Primitives Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's primitives and their current status.<br />
<br />
==== BRL-CAD Geometry Converter Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's geometry converters.<br />
<br />
==== Release Schedule ====<br />
<br />
Explain our release schedule and versioning system.<br />
<br />
==== RTGL ====<br />
<br />
Article on Nick's point-based visualization mode.<br />
<br />
==== BRL-CAD Quick Reference Card ====<br />
<br />
Article on a BRL-CAD QRC similar to the existing MGED QRC.<br />
<br />
==== BRL-CAD Bibliography ====<br />
<br />
After the .bib gets published to the website, an article announcing it and soliciting additions.<br />
<br />
==== Revolve Primitive ====<br />
<br />
Article on Timothy Van Ruitenbeek's work implementing 'revolve'.<br />
<br />
==== Parametrics and Constraints ====<br />
<br />
Article on Dawn Thomas' work to integrate parametric equation and constraint evaluation support.<br />
<br />
==== Converting Implicit to Explicit: CSG to BREP NURBS ====<br />
<br />
Article on the work by Cliff Yapp, Joe Doliner, and Ben Poole converting primitives with an implicit representation into an explicit NURBS representation.<br />
<br />
==== Online Model Repository ====<br />
<br />
Article on Elena Băutu's work developing the model repository website.<br />
<br />
==== Project Statistics for 2010 ====<br />
<br />
Article on our current stats similar to previous years.<br />
<br />
==== Next Generation BRL-CAD ====<br />
<br />
Article on our super secret awesome new GUI.</div>Plussaihttps://brlcad.org/w/index.php?title=Community_Publication_Portal&diff=4593Community Publication Portal2012-11-15T08:41:00Z<p>Plussai: /* For surface tree */</p>
<hr />
<div>Welcome to the BRL-CAD community publication portal. This page is dedicated to the preparation and editing of BRL-CAD announcements. Proposed and upcoming topics are listed. Anyone is '''welcome and encouraged''' to share news about any activity related to BRL-CAD. Community editing and review are encouraged.<br />
<br />
__TOC__<br />
<br />
'''Formatting & Editing Standards:'''<br />
<br />
* Quotations are italicized and placed between double quotes ('' "Like This" '').<br />
<br />
* AA (All Acronyms) need to be defined upon first use, don't abbrev. words.<br />
<br />
* Section headings uppercase the major words and are in bold ('''Like This''')<br />
<br />
* Use the serial comma: one, two, and three; not one, two and three.<br />
<br />
* Cite references, include hyperlinks.<br />
<br />
* Keep it brief.<br />
<br />
'''Distribution Channels:'''<br />
<br />
For release publications, follow [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING HACKING]. For everything else, distribute to the following:<br />
<br />
* brlcad-news@lists.sourceforge.net<br />
* http://brlcad.org/d/node/add/story<br />
* https://sourceforge.net/news/?group_id=105292<br />
* (optional) https://brlcad.org/wiki/<br />
* (optional) http://www.tenlinks.com/NEWS/tl_daily/submit_news.htm<br />
* (optional) http://upfrontezine.com<br />
<br />
----<br />
----<br />
<br />
== Ready for Publication ==<br />
These articles are ready for publication. Release notes should be posted after tarballs, ideally the last or first week of a month. Other publications should be scheduled one or two weeks later, ideally on the second or third week of the month.<br />
<br />
Note: if you see a comment indicating that a section is FROZEN, any changes you make in that section may go unnoticed as the article is being prepared for distribution. If you find errors in a FROZEN article, go ahead and correct the article but contact Sean (brlcad on freenode [[IRC]]) who may be able to incorporate changes during final publication.<br />
<br />
==== Move from Final Review to Here When Ready====<br />
<br />
<br />
----<br />
<br />
== Final Editorial Review ==<br />
These should be "complete" articles. The author is done. All that remains is a structure, grammar, voice, punctuation, and spelling review. Images welcome.<br />
<br />
==== Kyle Bodt: Ronja ====<br />
<br />
http://brlcad.org/wiki/Ronja<br />
<br />
Ronja (Reasonable Optical Near Joint Access) is an innovative piece of equipment that utilizes reliable optical data links to create a current communication range of 1.4 km and a speed of 10Mbps full duplex that can be used as a general purpose wireless link for virtually any networking project. This is a very important project for Twibright Labs, a small group of computer science graduate students operating out of Charles University in Prague in the Czech Republic. The group specializes in the usage of Free Software and User Controlled Technology Development.<br />
<br />
The primary output for the Ronja project is a design. The lab does not intend to manufacture and sell the hardware that is being designed but wants to engage in open source development of the technology. The philosophy surrounding User Controlled Technology is the ideal that the end-user is provided with unrestricted access to the intellectual property surrounding the technology, including the tools that are being used to create it. One tool playing an integral part in the development of the Ronja designs is BRL-CAD. All of the models that Twibright labs use to display the different variants of their Ronja concept were created with the help of BRL-CAD. BRL-CAD has allowed the members of Twibright labs to create instructional diagrams so that the users and builders of their open source technology will be able to have the latest information with regard to the proper construction of a Ronja unit. The interactive geometry editor and ray-tracers in BRL-CAD are an integral part in the communication of design plans for Twibright labs and enables them to connect with the users, who are the driving force behind the User Controlled Technology ideal.<br />
<br />
----<br />
<br />
== Initial Drafts ==<br />
These are incomplete articles being worked on. Short 250 to 500-word articles (not counting tables, images, etc) are usually perfect.<br />
<br />
==== Anurag Murty: Voxelizing Geometry ====<br />
Given a set of primitives as input, the voxelize command uses the data obtained from BRL-CAD's raytracer to represent the input in the form of voxels(Volumetric Picture Elements). A uniform grid of rays is uniformly shot on the given input and an approximation of the volume filled in each voxel region is made from the raytracing data. Depending on the approximate volume of the voxel filled, a voxel is classified as IN or OUT of the voxelized output. The voxels are represented as RPPs. <br />
Such voxelized outputs have applications in Volumetric rendering and finite element analysis.<br />
<br />
SYNTAX : <br />
voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]<br />
<br />
ARGUMENTS-<br />
<br />
-d - Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values<br />
<br />
-s - Specifies the voxel size in each direction. <br />
<br />
-t - Specifies the threshold volume to decide if voxel is to be included in the voxelized output. <br />
<br />
new_obj - Name for resultant primitive that is a region containing the resulting voxels. <br />
<br />
old_obj - Name of source primitive or collection.<br />
<br />
<br />
NOTES- <br />
<br />
1. A greater level of detail usually implies a much better approximation of fill volumes at the cost of more computations.<br />
<br />
2. Lesser voxel sizes give a more precise representation of the input at the cost of more memory requirements.<br />
<br />
3. Threshold value (the argument of -t) should be a value between 0 and 1, and not a percentage.<br />
<br />
==== Cristina Precup: Visualizing Directed Acyclic Graphs ====<br />
'''Visualizing Constructive Solid Geometry''' is a project meant to illustrate in an intuitive and interactive manner the hierarchical structure of .g geometry databases.<br />
<br />
For the representation of the hierarchies, the '''Adaptagrams''' graph library has been used. This made possible organizing the objects contained within the database into directed acyclic graphs.<br />
<br />
Following, are the steps that have been taken in developing the graph layout API:<br />
<br />
* Integrate the Adaptagrams library into BRL-CAD.<br />
* Traverse the geometry database and distinguish different types of objects (''primitive'', ''combination'', ''non-geometry'') within it, as well as, establish the operations between them (''union'', ''difference'', ...). Add all this data to the graph structure constructed with Adaptagrams.<br />
* Display the objects using a Tk Canvas widget inside a window.<br />
* Develop a ''decorative routine'' that sets different colors for different types of objects, correspondingly.<br />
* Create a name label for each represented object.<br />
* Develop a layout algorithm that aligns the nodes of the graph in a hierarchical way.<br />
* Introduce the '''graph''' command in both '''MGED''' and '''Archer'''. It has two subcommands:<br />
** '''show''' which displays a list with the name and type of the objects along with the nodes' and edges' positions;<br />
** '''positions''' that lists the names, types and positions of the corresponding nodes within the graph;<br />
* Introduce the '''igraph''' command in both MGED and Archer. This command pops up a graph based visualization window of the currently opened .g database. Its documentation can be found in ''brlman''.<br />
<br />
As an example, here is how the graph for the ''share/db/axis.g'' database looks like now:<br />
:[[Image:Graph_editor_v2.png]]<br />
<br />
Further work that can extend the ''interactive'' trait of the graph layout API includes adding user actions upon the graph such as ''move'' (dragging a node) or ''delete'' functionalities.<br />
<br />
==== Ksenija Slivko: Reducing Code ====<br />
<br />
===== Abstract =====<br />
The main aim of this project was to decrease the number of lines of code in the project. Since the project is being developing for quite a long time there were many "copy-pastes". They were redacted. <br />
<br />
===== The process of developing =====<br />
Coding period can be divided into three parts:<br />
* reduction in the single files<br />
* reduction in different files in the single program or library<br />
* reduction in different libraries<br />
<br />
===== Improving =====<br />
Since the project is quite large the redaction can be continued<br />
<br />
==== Laijiren: NURBS Tessellation: What, Why, How? ====<br />
===== Abstract =====<br />
Non-Uniform Rational B-Spline surfaces are widely used in CAD system. But they are not suitable for direct visualization on modern GPU systems. Today’s graphics hardware supports the high-speed display of polygonal objects consisting of triangles. This means that analytical surfaces (like NURBS) need to be triangulated so they can be displayed by 3D graphics cards.<br />
<br />
===== Main work =====<br />
===== For debugging tool =====<br />
*add 'info TB' 'info SB' to display information of piecewise bezier trim curve<br />
*add 'info T' 'info E' to display information of trim curve in parameter region and edge in 3d region<br />
*add 'plot SCV' to display control point net and 'plot TESS' to display the result of tessellation<br />
<br />
===== For surface tree =====<br />
*subdivide a Nurbs surface in a adaptive method and a new recursion termination condition for surface subdivision.<br />
reference:NURBS rendering in OpenSG Plus<br />
*implement the doTrimming function in Surface tree.<br />
1)compute the intersection between trim curve and rect's edge of sub-surface in parameter region<br />
<br />
2)implement a trimLoop class to get the valid loop and the trimmed loop<br />
<br />
3)triangulate the valid loop in form of polygon<br />
<br />
==== Suryajith Chillara: Benchmark Performance Database ====<br />
===== Abstract =====<br />
The main idea is to store the data both in the database and the log files stored in the archive. The storage in the database enables the content to be searched via the parameters such as machine descriptions, versions, results and could be compared. The storage as a file in the archive is to maintain a back up of the file and whenever a developer needs a specific bunch of benchmark logs, he could get them from the archive with or without the help of the database.<br />
<br />
===== Main Components =====<br />
* '''Log Parser :''' The data of the log file needs to be parsed and the relevant and important information has to be logged in the database so as to make the data access for the graphic display through the frontend could be made possible. <br />
* '''Web API :''' Implemented via the bottle framework so as to submit the logs from the brlcad installation via scripts.<br />
* '''Web backend :''' A backend has been implemented as a MVC framework from scratch using the python bottle framework. <br />
* '''Frontend :''' The website that can offer multiple mechanisms for adding new performance run data into the database and provide multiple graphical and non-graphical visualizations of aggregate performance data (i.e., graphs, charts, tables, etc). Graphs, tables and charts are generated with the help of Google Charts via wrapper which generates the javascript code to interact with the Google Charts service.<br />
[[Image:Absavgperfvsimagescomb.png]]<br />
<br />
<br />
Plumbing between these components is via the python scripts. <br />
<br />
<br />
===== Tool & Service dependancies =====<br />
* Python 2.7 and libraries<br />
* Bottle web framework<br />
* MySQL<br />
* Google Charts<br />
<br />
==== Wu Jianbang: NURBS surface-surface intersections ====<br />
I focused on the "NURBS surface-surface intersections" project after the mid-term evaluation of this year's GSoC, before which I worked on converting implicit primitives to NURBS B-rep forms.<br />
<br />
The function calculating NURBS surface-surface intersection curves is surface_surface_intersection() which is declared in include/nurbs.h and implemented in src/libnurbs/opennurbs_ext.cpp. It outputs intersection curves in 3d space and in both surfaces' UV parameter spaces.<br />
<br />
The approach of the algorithm originates from:<br />
<br />
Adarsh Krishnamurthy, Rahul Khardekar, Sara McMains, Kirk Haller, and Gershon Elber. 2008. Performing efficient NURBS modeling operations on the GPU. In Proceedings of the 2008 ACM symposium on Solid and physical modeling (SPM '08). ACM, New York, NY, USA, 257-268. DOI=10.1145/1364901.1364937 http://doi.acm.org/10.1145/1364901.1364937<br />
<br />
It can be divided into several steps:<br />
<br />
* Generate the bounding box of the two surfaces.<br />
* If their bounding boxes intersect:<br />
** Split the two surfaces, both into four parts, and calculate the sub-surfaces' bounding boxes<br />
** Calculate the intersection of sub-surfaces' bboxes, if they do intersect, go deeper with splitting surfaces and smaller bboxes, otherwise trace back.<br />
* After getting the intersecting bboxes, approximate the surface inside the bbox with two triangles, and calculate the intersection points of the triangles (both in 3d space and two surfaces' UV space)<br />
* Fit the intersection points into polyline curves, and then to NURBS curves. Points with distance less than max_dis are considered in one curve.<br />
<br />
It needs to be mentioned here that the value max_dis can be provided by the user or generated automatically.<br />
<br />
Besides, after calculating the intersection curves, the next steps towords evaluated NURBS are splitting the surfaces into sub-surfaces with the intersection curves as their boundaries, and some inside-outside tests to decide which sub-surfaces should be included in the final object. Some work on splitting has been done, generating some b-rep faces that can pass IsValid(), but still further work is needed.<br />
<br />
==== Andrei Popescu: Network Performance Testing ====<br />
<br />
The project that I have been working on during the summer, as part of the Google Summer of Code program,<br> can be broken down into three independent parts and it consisted in running various tests for the BRL-CAD<br> networking library(Libpkg) .<br />
<br />
*Speed testing and investigations to uncover any potential performance bottleneck.<br />
*Unit tests and code review to find and cover any untreated exceptions(crashes) in the Libpkg library.<br />
*Eliminate the assumption of globals in the API.<br />
<br />
For the first part, I have run two types of tests : <br><br />
<br />
Local ones, both the "sender" and the "receiver" were located on localhost.<br />
The script gathered data<br> regarding the transmission speed for each set of package sizes (Here, package refers to the package <br>created by networking library, not networking packages) respectively file sizes.<br />
<br />
Remote ones, where the "sender" and the "receiver" were on separate machines, connected using SSH.<br> The script ran and the data gathered was done in the same way as the localhost one.Using the data <br> obtained from the tests, two 3D graphs were drawn.However, the tests were inconclusive, I could not find<br> an "ideal" package size to use regardless of file size.<br />
<br />
After Mid-term I focused mostly on second part. I used test units from libbu(Utility library) as an example<br> for the unit test type and design.<br />
When the mentioned tests were run, several exceptions that caused<br> crashes were discovered. Lastly, I have written fixes for the discovered crashes.<br />
<br />
The third part of the project has not been covered yet, so more work is needed.Although, I am doing my<br> best to finish it in the following weeks.<br />
<br />
==== Chris Dueck: Calculating 2D Sketch Surface Area ====<br />
<br />
Calculating the surface area of a 2D Sketch primitive is not a trivial task. Sketches are created interactively by the user, and can contain straight line segments, circular arc segments (and full circles), as well as Bezier and NURBS curves.<br />
<br />
The method used to approximately compute the area of a 2D sketch is as follows:<br />
<br />
*1.) Approximate the sketch by a polygon<br />
*2.) Compute the area of the polygon exactly using Green's Theorem<br />
*3.) Add the areas of any circular arc segments that were created during (1)<br />
<br />
To approximate the sketch by a polygon, each possible curve type of a sketch must be considered.<br />
<br />
*If the curve is a straight line, it need not be approximated.<br />
<br />
*If the curve is a circular arc, it must be determined if it is a full circle (in which case its area can be computed easily) or if it is a circular arc segment. If it is a circular arc segment, the line segment from the beginning of the arc to the endpoint is added to the polygon, and the excess area of the circular arc segment itself can be calculated easily (https://en.wikipedia.org/wiki/Circular_segment)<br />
<br />
*If the curve is a Bezier curve, it can be approximated by a series of circular arcs. The algorithm used can be found here (http://itc.ktu.lt/itc354/Riskus354.pdf). The algorithm recursively subdivides the Bezier until it is approximated to tolerance by a biarc and uses the curvature value of the Bezier at a point to determine the depth of subdivision. Then each circular arc in the approximation of the Bezier curve is treated as above.<br />
<br />
Finally, the area of the polygon can be efficiently calculated using Green's Theorem (http://www.softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#3D%20Standard%20Formula) using cross products.<br />
<br />
==== Cliff Yapp: NURBS Ray Tracing in BRL-CAD ====<br />
<br />
Over the past year, an intense development effort by BRL-CAD's development team has successfully implemented raytracing of Non-Uniform Rational BSpline (NURBS) geometry within the BRL-CAD Computer-Aided Design (CAD) package. NURBS surfaces are very general, very complex mathematical shapes used by virtually all modern commercial CAD software packages. Because BRL-CAD did not originally support this type of geometry, commercial models could only be imported into BRL-CAD after a labor-intensive and difficult conversion process from NURBS form to triangle-base geometry (referred to in BRL-CAD as Bags-of-Triangles or BoTs). The new NURBS raytracing capability builds on work by many developers over a period of years, who in turn built on the open source library OpenNURBS. Support for this primitive type means BRL-CAD can now store and raytrace data from commercial models without requiring preliminary conversion to another type of geometry.<br />
<br />
The last major feature needed to make import of commercial models in BRL-CAD straightforward is conversion support for ISO’s "Standard for the Exchange of Product model data" or STEP file format. STEP uses NURBS geometry in its definition, making support for NURBS geometry a necessary prelude to support for STEP import. Most commercial CAD modelers support this file format as an output option, hence STEP support in BRL-CAD would allow a direct path for moving geometric descriptions from a variety of commercial modelers to BRL-CAD. Considerable progress has already been made on STEP import support, but more work is need to bring the code and feature set to "production quality". If anyone would like to join the BRL-CAD open source development effort and has a little familiarity with C++, the step-g converter and its supporting libraries have some simple-yet-useful tasks that would be an excellent and very useful way to explore the project - join BRL-CAD's IRC channel or development email list if you are interested!<br />
<br />
==== Erik Greenwald: Bolting ADRT's libtie under the hood ====<br />
<br />
[[Image:BoTvsTie.png|right|thumb|256px|BoT vs Tie pixdiff]]<br />
<br />
Initial progress on the integration of ADRT's libtie "triangle intersection engine" with LIBRT.<br />
<br />
----<br />
<br />
== Idea Hopper ==<br />
These are ideas for interesting or useful publications. We need someone to at least write a draft.<br />
<br />
==== BRL-CAD's Evolutionary API ====<br />
<br />
Talk about BRL-CAD deprecation process.<br />
<br />
==== Introduction to new .deb and .rpm builds ====<br />
<br />
Brief article overviewing the efforts by jordisayol for Debian, Ubuntu, Fedora, and openSUSE. Included are new icons, menu items, mime type associations, and more.<br />
<br />
==== 2010 End Of Year Review ====<br />
<br />
Article giving an overview of the past year's highlight developments with hints at what 2011 may bring. Alternatively, may be the annual statistics review if we switch from fiscal to calendar year reporting.<br />
<br />
==== Erik Greenwald: ADRT/ISST Visualization ====<br />
<br />
Article introducing ADRT/ISST core capability.<br />
<br />
==== Bob Parker: Alpha Archer: Working Towards Next Generation MGED ====<br />
<br />
Article introducing Archer's core new features that will be "coming" to MGED. Undo, interactive editing, tree view, and info panels come to mind.<br />
<br />
==== Finding the Hot Spots ====<br />
<br />
Article on the rt lighting model Stephen Kennedy developed that visualizes the time spent per-pixel.<br />
<br />
==== Point Clouds ====<br />
<br />
Article introducing the new point cloud primitive.<br />
<br />
==== bn_mat_inv: singular matrix ====<br />
<br />
Article on the v4 format and binary compatibility.<br />
<br />
==== Model Showcase: Goliath ====<br />
<br />
Article talking about the making of the Goliath model.<br />
<br />
==== Model Showcase: Chumaciera ====<br />
<br />
Article on Pedro Baptista's bearing model.<br />
<br />
==== Model Showcase: Proyecto Catapulta ====<br />
<br />
Article on a model developed by André Santos, António Almeida, and Pedro Ferreira.<br />
<br />
==== Model Showcase: Union Coupling Tool ====<br />
<br />
Article on a model developed by Inês de Matos under teacher Luís Ferreira. The project focuses on a tool, union coupling, based on the book, http://purl.pt/14352 , page 122 of the original book and page 128 of the file, figures 108 and 109.<br />
<br />
==== Geometry Service FAQ ====<br />
<br />
FAQ summarization of the GS as it pertains to the wider open source community.<br />
<br />
==== BRL-CAD's 3rd Generation Build System ====<br />
<br />
Article on the new CMake build system.<br />
<br />
==== BRL-CAD's Open Source Vision ====<br />
<br />
Article introducing the Project Priorities diagram and overall project vision.<br />
<br />
==== BRL-CAD Primitives Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's primitives and their current status.<br />
<br />
==== BRL-CAD Geometry Converter Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's geometry converters.<br />
<br />
==== Release Schedule ====<br />
<br />
Explain our release schedule and versioning system.<br />
<br />
==== RTGL ====<br />
<br />
Article on Nick's point-based visualization mode.<br />
<br />
==== BRL-CAD Quick Reference Card ====<br />
<br />
Article on a BRL-CAD QRC similar to the existing MGED QRC.<br />
<br />
==== BRL-CAD Bibliography ====<br />
<br />
After the .bib gets published to the website, an article announcing it and soliciting additions.<br />
<br />
==== Revolve Primitive ====<br />
<br />
Article on Timothy Van Ruitenbeek's work implementing 'revolve'.<br />
<br />
==== Parametrics and Constraints ====<br />
<br />
Article on Dawn Thomas' work to integrate parametric equation and constraint evaluation support.<br />
<br />
==== Converting Implicit to Explicit: CSG to BREP NURBS ====<br />
<br />
Article on the work by Cliff Yapp, Joe Doliner, and Ben Poole converting primitives with an implicit representation into an explicit NURBS representation.<br />
<br />
==== Online Model Repository ====<br />
<br />
Article on Elena Băutu's work developing the model repository website.<br />
<br />
==== Project Statistics for 2010 ====<br />
<br />
Article on our current stats similar to previous years.<br />
<br />
==== Next Generation BRL-CAD ====<br />
<br />
Article on our super secret awesome new GUI.</div>Plussaihttps://brlcad.org/w/index.php?title=Community_Publication_Portal&diff=4592Community Publication Portal2012-11-15T08:39:43Z<p>Plussai: /* Main work */</p>
<hr />
<div>Welcome to the BRL-CAD community publication portal. This page is dedicated to the preparation and editing of BRL-CAD announcements. Proposed and upcoming topics are listed. Anyone is '''welcome and encouraged''' to share news about any activity related to BRL-CAD. Community editing and review are encouraged.<br />
<br />
__TOC__<br />
<br />
'''Formatting & Editing Standards:'''<br />
<br />
* Quotations are italicized and placed between double quotes ('' "Like This" '').<br />
<br />
* AA (All Acronyms) need to be defined upon first use, don't abbrev. words.<br />
<br />
* Section headings uppercase the major words and are in bold ('''Like This''')<br />
<br />
* Use the serial comma: one, two, and three; not one, two and three.<br />
<br />
* Cite references, include hyperlinks.<br />
<br />
* Keep it brief.<br />
<br />
'''Distribution Channels:'''<br />
<br />
For release publications, follow [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING HACKING]. For everything else, distribute to the following:<br />
<br />
* brlcad-news@lists.sourceforge.net<br />
* http://brlcad.org/d/node/add/story<br />
* https://sourceforge.net/news/?group_id=105292<br />
* (optional) https://brlcad.org/wiki/<br />
* (optional) http://www.tenlinks.com/NEWS/tl_daily/submit_news.htm<br />
* (optional) http://upfrontezine.com<br />
<br />
----<br />
----<br />
<br />
== Ready for Publication ==<br />
These articles are ready for publication. Release notes should be posted after tarballs, ideally the last or first week of a month. Other publications should be scheduled one or two weeks later, ideally on the second or third week of the month.<br />
<br />
Note: if you see a comment indicating that a section is FROZEN, any changes you make in that section may go unnoticed as the article is being prepared for distribution. If you find errors in a FROZEN article, go ahead and correct the article but contact Sean (brlcad on freenode [[IRC]]) who may be able to incorporate changes during final publication.<br />
<br />
==== Move from Final Review to Here When Ready====<br />
<br />
<br />
----<br />
<br />
== Final Editorial Review ==<br />
These should be "complete" articles. The author is done. All that remains is a structure, grammar, voice, punctuation, and spelling review. Images welcome.<br />
<br />
==== Kyle Bodt: Ronja ====<br />
<br />
http://brlcad.org/wiki/Ronja<br />
<br />
Ronja (Reasonable Optical Near Joint Access) is an innovative piece of equipment that utilizes reliable optical data links to create a current communication range of 1.4 km and a speed of 10Mbps full duplex that can be used as a general purpose wireless link for virtually any networking project. This is a very important project for Twibright Labs, a small group of computer science graduate students operating out of Charles University in Prague in the Czech Republic. The group specializes in the usage of Free Software and User Controlled Technology Development.<br />
<br />
The primary output for the Ronja project is a design. The lab does not intend to manufacture and sell the hardware that is being designed but wants to engage in open source development of the technology. The philosophy surrounding User Controlled Technology is the ideal that the end-user is provided with unrestricted access to the intellectual property surrounding the technology, including the tools that are being used to create it. One tool playing an integral part in the development of the Ronja designs is BRL-CAD. All of the models that Twibright labs use to display the different variants of their Ronja concept were created with the help of BRL-CAD. BRL-CAD has allowed the members of Twibright labs to create instructional diagrams so that the users and builders of their open source technology will be able to have the latest information with regard to the proper construction of a Ronja unit. The interactive geometry editor and ray-tracers in BRL-CAD are an integral part in the communication of design plans for Twibright labs and enables them to connect with the users, who are the driving force behind the User Controlled Technology ideal.<br />
<br />
----<br />
<br />
== Initial Drafts ==<br />
These are incomplete articles being worked on. Short 250 to 500-word articles (not counting tables, images, etc) are usually perfect.<br />
<br />
==== Anurag Murty: Voxelizing Geometry ====<br />
Given a set of primitives as input, the voxelize command uses the data obtained from BRL-CAD's raytracer to represent the input in the form of voxels(Volumetric Picture Elements). A uniform grid of rays is uniformly shot on the given input and an approximation of the volume filled in each voxel region is made from the raytracing data. Depending on the approximate volume of the voxel filled, a voxel is classified as IN or OUT of the voxelized output. The voxels are represented as RPPs. <br />
Such voxelized outputs have applications in Volumetric rendering and finite element analysis.<br />
<br />
SYNTAX : <br />
voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]<br />
<br />
ARGUMENTS-<br />
<br />
-d - Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values<br />
<br />
-s - Specifies the voxel size in each direction. <br />
<br />
-t - Specifies the threshold volume to decide if voxel is to be included in the voxelized output. <br />
<br />
new_obj - Name for resultant primitive that is a region containing the resulting voxels. <br />
<br />
old_obj - Name of source primitive or collection.<br />
<br />
<br />
NOTES- <br />
<br />
1. A greater level of detail usually implies a much better approximation of fill volumes at the cost of more computations.<br />
<br />
2. Lesser voxel sizes give a more precise representation of the input at the cost of more memory requirements.<br />
<br />
3. Threshold value (the argument of -t) should be a value between 0 and 1, and not a percentage.<br />
<br />
==== Cristina Precup: Visualizing Directed Acyclic Graphs ====<br />
'''Visualizing Constructive Solid Geometry''' is a project meant to illustrate in an intuitive and interactive manner the hierarchical structure of .g geometry databases.<br />
<br />
For the representation of the hierarchies, the '''Adaptagrams''' graph library has been used. This made possible organizing the objects contained within the database into directed acyclic graphs.<br />
<br />
Following, are the steps that have been taken in developing the graph layout API:<br />
<br />
* Integrate the Adaptagrams library into BRL-CAD.<br />
* Traverse the geometry database and distinguish different types of objects (''primitive'', ''combination'', ''non-geometry'') within it, as well as, establish the operations between them (''union'', ''difference'', ...). Add all this data to the graph structure constructed with Adaptagrams.<br />
* Display the objects using a Tk Canvas widget inside a window.<br />
* Develop a ''decorative routine'' that sets different colors for different types of objects, correspondingly.<br />
* Create a name label for each represented object.<br />
* Develop a layout algorithm that aligns the nodes of the graph in a hierarchical way.<br />
* Introduce the '''graph''' command in both '''MGED''' and '''Archer'''. It has two subcommands:<br />
** '''show''' which displays a list with the name and type of the objects along with the nodes' and edges' positions;<br />
** '''positions''' that lists the names, types and positions of the corresponding nodes within the graph;<br />
* Introduce the '''igraph''' command in both MGED and Archer. This command pops up a graph based visualization window of the currently opened .g database. Its documentation can be found in ''brlman''.<br />
<br />
As an example, here is how the graph for the ''share/db/axis.g'' database looks like now:<br />
:[[Image:Graph_editor_v2.png]]<br />
<br />
Further work that can extend the ''interactive'' trait of the graph layout API includes adding user actions upon the graph such as ''move'' (dragging a node) or ''delete'' functionalities.<br />
<br />
==== Ksenija Slivko: Reducing Code ====<br />
<br />
===== Abstract =====<br />
The main aim of this project was to decrease the number of lines of code in the project. Since the project is being developing for quite a long time there were many "copy-pastes". They were redacted. <br />
<br />
===== The process of developing =====<br />
Coding period can be divided into three parts:<br />
* reduction in the single files<br />
* reduction in different files in the single program or library<br />
* reduction in different libraries<br />
<br />
===== Improving =====<br />
Since the project is quite large the redaction can be continued<br />
<br />
==== Laijiren: NURBS Tessellation: What, Why, How? ====<br />
===== Abstract =====<br />
Non-Uniform Rational B-Spline surfaces are widely used in CAD system. But they are not suitable for direct visualization on modern GPU systems. Today’s graphics hardware supports the high-speed display of polygonal objects consisting of triangles. This means that analytical surfaces (like NURBS) need to be triangulated so they can be displayed by 3D graphics cards.<br />
<br />
===== Main work =====<br />
===== For debugging tool =====<br />
*add 'info TB' 'info SB' to display information of piecewise bezier trim curve<br />
*add 'info T' 'info E' to display information of trim curve in parameter region and edge in 3d region<br />
*add 'plot SCV' to display control point net and 'plot TESS' to display the result of tessellation<br />
<br />
===== For surface tree =====<br />
*subdivide a Nurbs surface in a adaptive method and a new recursion termination condition for surface subdivision.<br />
reference:NURBS rendering in OpenSG Plus<br />
*implement the doTrimming function in Surface tree.<br />
1)compute the intersection between trim curve and rect's edge of sub-surface in parameter region<br />
2)implement a trimLoop class to get the valid loop and the trimmed loop<br />
3)triangulate the valid loop in form of polygon<br />
<br />
==== Suryajith Chillara: Benchmark Performance Database ====<br />
===== Abstract =====<br />
The main idea is to store the data both in the database and the log files stored in the archive. The storage in the database enables the content to be searched via the parameters such as machine descriptions, versions, results and could be compared. The storage as a file in the archive is to maintain a back up of the file and whenever a developer needs a specific bunch of benchmark logs, he could get them from the archive with or without the help of the database.<br />
<br />
===== Main Components =====<br />
* '''Log Parser :''' The data of the log file needs to be parsed and the relevant and important information has to be logged in the database so as to make the data access for the graphic display through the frontend could be made possible. <br />
* '''Web API :''' Implemented via the bottle framework so as to submit the logs from the brlcad installation via scripts.<br />
* '''Web backend :''' A backend has been implemented as a MVC framework from scratch using the python bottle framework. <br />
* '''Frontend :''' The website that can offer multiple mechanisms for adding new performance run data into the database and provide multiple graphical and non-graphical visualizations of aggregate performance data (i.e., graphs, charts, tables, etc). Graphs, tables and charts are generated with the help of Google Charts via wrapper which generates the javascript code to interact with the Google Charts service.<br />
[[Image:Absavgperfvsimagescomb.png]]<br />
<br />
<br />
Plumbing between these components is via the python scripts. <br />
<br />
<br />
===== Tool & Service dependancies =====<br />
* Python 2.7 and libraries<br />
* Bottle web framework<br />
* MySQL<br />
* Google Charts<br />
<br />
==== Wu Jianbang: NURBS surface-surface intersections ====<br />
I focused on the "NURBS surface-surface intersections" project after the mid-term evaluation of this year's GSoC, before which I worked on converting implicit primitives to NURBS B-rep forms.<br />
<br />
The function calculating NURBS surface-surface intersection curves is surface_surface_intersection() which is declared in include/nurbs.h and implemented in src/libnurbs/opennurbs_ext.cpp. It outputs intersection curves in 3d space and in both surfaces' UV parameter spaces.<br />
<br />
The approach of the algorithm originates from:<br />
<br />
Adarsh Krishnamurthy, Rahul Khardekar, Sara McMains, Kirk Haller, and Gershon Elber. 2008. Performing efficient NURBS modeling operations on the GPU. In Proceedings of the 2008 ACM symposium on Solid and physical modeling (SPM '08). ACM, New York, NY, USA, 257-268. DOI=10.1145/1364901.1364937 http://doi.acm.org/10.1145/1364901.1364937<br />
<br />
It can be divided into several steps:<br />
<br />
* Generate the bounding box of the two surfaces.<br />
* If their bounding boxes intersect:<br />
** Split the two surfaces, both into four parts, and calculate the sub-surfaces' bounding boxes<br />
** Calculate the intersection of sub-surfaces' bboxes, if they do intersect, go deeper with splitting surfaces and smaller bboxes, otherwise trace back.<br />
* After getting the intersecting bboxes, approximate the surface inside the bbox with two triangles, and calculate the intersection points of the triangles (both in 3d space and two surfaces' UV space)<br />
* Fit the intersection points into polyline curves, and then to NURBS curves. Points with distance less than max_dis are considered in one curve.<br />
<br />
It needs to be mentioned here that the value max_dis can be provided by the user or generated automatically.<br />
<br />
Besides, after calculating the intersection curves, the next steps towords evaluated NURBS are splitting the surfaces into sub-surfaces with the intersection curves as their boundaries, and some inside-outside tests to decide which sub-surfaces should be included in the final object. Some work on splitting has been done, generating some b-rep faces that can pass IsValid(), but still further work is needed.<br />
<br />
==== Andrei Popescu: Network Performance Testing ====<br />
<br />
The project that I have been working on during the summer, as part of the Google Summer of Code program,<br> can be broken down into three independent parts and it consisted in running various tests for the BRL-CAD<br> networking library(Libpkg) .<br />
<br />
*Speed testing and investigations to uncover any potential performance bottleneck.<br />
*Unit tests and code review to find and cover any untreated exceptions(crashes) in the Libpkg library.<br />
*Eliminate the assumption of globals in the API.<br />
<br />
For the first part, I have run two types of tests : <br><br />
<br />
Local ones, both the "sender" and the "receiver" were located on localhost.<br />
The script gathered data<br> regarding the transmission speed for each set of package sizes (Here, package refers to the package <br>created by networking library, not networking packages) respectively file sizes.<br />
<br />
Remote ones, where the "sender" and the "receiver" were on separate machines, connected using SSH.<br> The script ran and the data gathered was done in the same way as the localhost one.Using the data <br> obtained from the tests, two 3D graphs were drawn.However, the tests were inconclusive, I could not find<br> an "ideal" package size to use regardless of file size.<br />
<br />
After Mid-term I focused mostly on second part. I used test units from libbu(Utility library) as an example<br> for the unit test type and design.<br />
When the mentioned tests were run, several exceptions that caused<br> crashes were discovered. Lastly, I have written fixes for the discovered crashes.<br />
<br />
The third part of the project has not been covered yet, so more work is needed.Although, I am doing my<br> best to finish it in the following weeks.<br />
<br />
==== Chris Dueck: Calculating 2D Sketch Surface Area ====<br />
<br />
Calculating the surface area of a 2D Sketch primitive is not a trivial task. Sketches are created interactively by the user, and can contain straight line segments, circular arc segments (and full circles), as well as Bezier and NURBS curves.<br />
<br />
The method used to approximately compute the area of a 2D sketch is as follows:<br />
<br />
*1.) Approximate the sketch by a polygon<br />
*2.) Compute the area of the polygon exactly using Green's Theorem<br />
*3.) Add the areas of any circular arc segments that were created during (1)<br />
<br />
To approximate the sketch by a polygon, each possible curve type of a sketch must be considered.<br />
<br />
*If the curve is a straight line, it need not be approximated.<br />
<br />
*If the curve is a circular arc, it must be determined if it is a full circle (in which case its area can be computed easily) or if it is a circular arc segment. If it is a circular arc segment, the line segment from the beginning of the arc to the endpoint is added to the polygon, and the excess area of the circular arc segment itself can be calculated easily (https://en.wikipedia.org/wiki/Circular_segment)<br />
<br />
*If the curve is a Bezier curve, it can be approximated by a series of circular arcs. The algorithm used can be found here (http://itc.ktu.lt/itc354/Riskus354.pdf). The algorithm recursively subdivides the Bezier until it is approximated to tolerance by a biarc and uses the curvature value of the Bezier at a point to determine the depth of subdivision. Then each circular arc in the approximation of the Bezier curve is treated as above.<br />
<br />
Finally, the area of the polygon can be efficiently calculated using Green's Theorem (http://www.softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#3D%20Standard%20Formula) using cross products.<br />
<br />
==== Cliff Yapp: NURBS Ray Tracing in BRL-CAD ====<br />
<br />
Over the past year, an intense development effort by BRL-CAD's development team has successfully implemented raytracing of Non-Uniform Rational BSpline (NURBS) geometry within the BRL-CAD Computer-Aided Design (CAD) package. NURBS surfaces are very general, very complex mathematical shapes used by virtually all modern commercial CAD software packages. Because BRL-CAD did not originally support this type of geometry, commercial models could only be imported into BRL-CAD after a labor-intensive and difficult conversion process from NURBS form to triangle-base geometry (referred to in BRL-CAD as Bags-of-Triangles or BoTs). The new NURBS raytracing capability builds on work by many developers over a period of years, who in turn built on the open source library OpenNURBS. Support for this primitive type means BRL-CAD can now store and raytrace data from commercial models without requiring preliminary conversion to another type of geometry.<br />
<br />
The last major feature needed to make import of commercial models in BRL-CAD straightforward is conversion support for ISO’s "Standard for the Exchange of Product model data" or STEP file format. STEP uses NURBS geometry in its definition, making support for NURBS geometry a necessary prelude to support for STEP import. Most commercial CAD modelers support this file format as an output option, hence STEP support in BRL-CAD would allow a direct path for moving geometric descriptions from a variety of commercial modelers to BRL-CAD. Considerable progress has already been made on STEP import support, but more work is need to bring the code and feature set to "production quality". If anyone would like to join the BRL-CAD open source development effort and has a little familiarity with C++, the step-g converter and its supporting libraries have some simple-yet-useful tasks that would be an excellent and very useful way to explore the project - join BRL-CAD's IRC channel or development email list if you are interested!<br />
<br />
==== Erik Greenwald: Bolting ADRT's libtie under the hood ====<br />
<br />
[[Image:BoTvsTie.png|right|thumb|256px|BoT vs Tie pixdiff]]<br />
<br />
Initial progress on the integration of ADRT's libtie "triangle intersection engine" with LIBRT.<br />
<br />
----<br />
<br />
== Idea Hopper ==<br />
These are ideas for interesting or useful publications. We need someone to at least write a draft.<br />
<br />
==== BRL-CAD's Evolutionary API ====<br />
<br />
Talk about BRL-CAD deprecation process.<br />
<br />
==== Introduction to new .deb and .rpm builds ====<br />
<br />
Brief article overviewing the efforts by jordisayol for Debian, Ubuntu, Fedora, and openSUSE. Included are new icons, menu items, mime type associations, and more.<br />
<br />
==== 2010 End Of Year Review ====<br />
<br />
Article giving an overview of the past year's highlight developments with hints at what 2011 may bring. Alternatively, may be the annual statistics review if we switch from fiscal to calendar year reporting.<br />
<br />
==== Erik Greenwald: ADRT/ISST Visualization ====<br />
<br />
Article introducing ADRT/ISST core capability.<br />
<br />
==== Bob Parker: Alpha Archer: Working Towards Next Generation MGED ====<br />
<br />
Article introducing Archer's core new features that will be "coming" to MGED. Undo, interactive editing, tree view, and info panels come to mind.<br />
<br />
==== Finding the Hot Spots ====<br />
<br />
Article on the rt lighting model Stephen Kennedy developed that visualizes the time spent per-pixel.<br />
<br />
==== Point Clouds ====<br />
<br />
Article introducing the new point cloud primitive.<br />
<br />
==== bn_mat_inv: singular matrix ====<br />
<br />
Article on the v4 format and binary compatibility.<br />
<br />
==== Model Showcase: Goliath ====<br />
<br />
Article talking about the making of the Goliath model.<br />
<br />
==== Model Showcase: Chumaciera ====<br />
<br />
Article on Pedro Baptista's bearing model.<br />
<br />
==== Model Showcase: Proyecto Catapulta ====<br />
<br />
Article on a model developed by André Santos, António Almeida, and Pedro Ferreira.<br />
<br />
==== Model Showcase: Union Coupling Tool ====<br />
<br />
Article on a model developed by Inês de Matos under teacher Luís Ferreira. The project focuses on a tool, union coupling, based on the book, http://purl.pt/14352 , page 122 of the original book and page 128 of the file, figures 108 and 109.<br />
<br />
==== Geometry Service FAQ ====<br />
<br />
FAQ summarization of the GS as it pertains to the wider open source community.<br />
<br />
==== BRL-CAD's 3rd Generation Build System ====<br />
<br />
Article on the new CMake build system.<br />
<br />
==== BRL-CAD's Open Source Vision ====<br />
<br />
Article introducing the Project Priorities diagram and overall project vision.<br />
<br />
==== BRL-CAD Primitives Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's primitives and their current status.<br />
<br />
==== BRL-CAD Geometry Converter Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's geometry converters.<br />
<br />
==== Release Schedule ====<br />
<br />
Explain our release schedule and versioning system.<br />
<br />
==== RTGL ====<br />
<br />
Article on Nick's point-based visualization mode.<br />
<br />
==== BRL-CAD Quick Reference Card ====<br />
<br />
Article on a BRL-CAD QRC similar to the existing MGED QRC.<br />
<br />
==== BRL-CAD Bibliography ====<br />
<br />
After the .bib gets published to the website, an article announcing it and soliciting additions.<br />
<br />
==== Revolve Primitive ====<br />
<br />
Article on Timothy Van Ruitenbeek's work implementing 'revolve'.<br />
<br />
==== Parametrics and Constraints ====<br />
<br />
Article on Dawn Thomas' work to integrate parametric equation and constraint evaluation support.<br />
<br />
==== Converting Implicit to Explicit: CSG to BREP NURBS ====<br />
<br />
Article on the work by Cliff Yapp, Joe Doliner, and Ben Poole converting primitives with an implicit representation into an explicit NURBS representation.<br />
<br />
==== Online Model Repository ====<br />
<br />
Article on Elena Băutu's work developing the model repository website.<br />
<br />
==== Project Statistics for 2010 ====<br />
<br />
Article on our current stats similar to previous years.<br />
<br />
==== Next Generation BRL-CAD ====<br />
<br />
Article on our super secret awesome new GUI.</div>Plussaihttps://brlcad.org/w/index.php?title=Community_Publication_Portal&diff=4591Community Publication Portal2012-11-15T08:25:42Z<p>Plussai: /* Main Components */</p>
<hr />
<div>Welcome to the BRL-CAD community publication portal. This page is dedicated to the preparation and editing of BRL-CAD announcements. Proposed and upcoming topics are listed. Anyone is '''welcome and encouraged''' to share news about any activity related to BRL-CAD. Community editing and review are encouraged.<br />
<br />
__TOC__<br />
<br />
'''Formatting & Editing Standards:'''<br />
<br />
* Quotations are italicized and placed between double quotes ('' "Like This" '').<br />
<br />
* AA (All Acronyms) need to be defined upon first use, don't abbrev. words.<br />
<br />
* Section headings uppercase the major words and are in bold ('''Like This''')<br />
<br />
* Use the serial comma: one, two, and three; not one, two and three.<br />
<br />
* Cite references, include hyperlinks.<br />
<br />
* Keep it brief.<br />
<br />
'''Distribution Channels:'''<br />
<br />
For release publications, follow [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING HACKING]. For everything else, distribute to the following:<br />
<br />
* brlcad-news@lists.sourceforge.net<br />
* http://brlcad.org/d/node/add/story<br />
* https://sourceforge.net/news/?group_id=105292<br />
* (optional) https://brlcad.org/wiki/<br />
* (optional) http://www.tenlinks.com/NEWS/tl_daily/submit_news.htm<br />
* (optional) http://upfrontezine.com<br />
<br />
----<br />
----<br />
<br />
== Ready for Publication ==<br />
These articles are ready for publication. Release notes should be posted after tarballs, ideally the last or first week of a month. Other publications should be scheduled one or two weeks later, ideally on the second or third week of the month.<br />
<br />
Note: if you see a comment indicating that a section is FROZEN, any changes you make in that section may go unnoticed as the article is being prepared for distribution. If you find errors in a FROZEN article, go ahead and correct the article but contact Sean (brlcad on freenode [[IRC]]) who may be able to incorporate changes during final publication.<br />
<br />
==== Move from Final Review to Here When Ready====<br />
<br />
<br />
----<br />
<br />
== Final Editorial Review ==<br />
These should be "complete" articles. The author is done. All that remains is a structure, grammar, voice, punctuation, and spelling review. Images welcome.<br />
<br />
==== Kyle Bodt: Ronja ====<br />
<br />
http://brlcad.org/wiki/Ronja<br />
<br />
Ronja (Reasonable Optical Near Joint Access) is an innovative piece of equipment that utilizes reliable optical data links to create a current communication range of 1.4 km and a speed of 10Mbps full duplex that can be used as a general purpose wireless link for virtually any networking project. This is a very important project for Twibright Labs, a small group of computer science graduate students operating out of Charles University in Prague in the Czech Republic. The group specializes in the usage of Free Software and User Controlled Technology Development.<br />
<br />
The primary output for the Ronja project is a design. The lab does not intend to manufacture and sell the hardware that is being designed but wants to engage in open source development of the technology. The philosophy surrounding User Controlled Technology is the ideal that the end-user is provided with unrestricted access to the intellectual property surrounding the technology, including the tools that are being used to create it. One tool playing an integral part in the development of the Ronja designs is BRL-CAD. All of the models that Twibright labs use to display the different variants of their Ronja concept were created with the help of BRL-CAD. BRL-CAD has allowed the members of Twibright labs to create instructional diagrams so that the users and builders of their open source technology will be able to have the latest information with regard to the proper construction of a Ronja unit. The interactive geometry editor and ray-tracers in BRL-CAD are an integral part in the communication of design plans for Twibright labs and enables them to connect with the users, who are the driving force behind the User Controlled Technology ideal.<br />
<br />
----<br />
<br />
== Initial Drafts ==<br />
These are incomplete articles being worked on. Short 250 to 500-word articles (not counting tables, images, etc) are usually perfect.<br />
<br />
==== Anurag Murty: Voxelizing Geometry ====<br />
Given a set of primitives as input, the voxelize command uses the data obtained from BRL-CAD's raytracer to represent the input in the form of voxels(Volumetric Picture Elements). A uniform grid of rays is uniformly shot on the given input and an approximation of the volume filled in each voxel region is made from the raytracing data. Depending on the approximate volume of the voxel filled, a voxel is classified as IN or OUT of the voxelized output. The voxels are represented as RPPs. <br />
Such voxelized outputs have applications in Volumetric rendering and finite element analysis.<br />
<br />
SYNTAX : <br />
voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]<br />
<br />
ARGUMENTS-<br />
<br />
-d - Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values<br />
<br />
-s - Specifies the voxel size in each direction. <br />
<br />
-t - Specifies the threshold volume to decide if voxel is to be included in the voxelized output. <br />
<br />
new_obj - Name for resultant primitive that is a region containing the resulting voxels. <br />
<br />
old_obj - Name of source primitive or collection.<br />
<br />
<br />
NOTES- <br />
<br />
1. A greater level of detail usually implies a much better approximation of fill volumes at the cost of more computations.<br />
<br />
2. Lesser voxel sizes give a more precise representation of the input at the cost of more memory requirements.<br />
<br />
3. Threshold value (the argument of -t) should be a value between 0 and 1, and not a percentage.<br />
<br />
==== Cristina Precup: Visualizing Directed Acyclic Graphs ====<br />
'''Visualizing Constructive Solid Geometry''' is a project meant to illustrate in an intuitive and interactive manner the hierarchical structure of .g geometry databases.<br />
<br />
For the representation of the hierarchies, the '''Adaptagrams''' graph library has been used. This made possible organizing the objects contained within the database into directed acyclic graphs.<br />
<br />
Following, are the steps that have been taken in developing the graph layout API:<br />
<br />
* Integrate the Adaptagrams library into BRL-CAD.<br />
* Traverse the geometry database and distinguish different types of objects (''primitive'', ''combination'', ''non-geometry'') within it, as well as, establish the operations between them (''union'', ''difference'', ...). Add all this data to the graph structure constructed with Adaptagrams.<br />
* Display the objects using a Tk Canvas widget inside a window.<br />
* Develop a ''decorative routine'' that sets different colors for different types of objects, correspondingly.<br />
* Create a name label for each represented object.<br />
* Develop a layout algorithm that aligns the nodes of the graph in a hierarchical way.<br />
* Introduce the '''graph''' command in both '''MGED''' and '''Archer'''. It has two subcommands:<br />
** '''show''' which displays a list with the name and type of the objects along with the nodes' and edges' positions;<br />
** '''positions''' that lists the names, types and positions of the corresponding nodes within the graph;<br />
* Introduce the '''igraph''' command in both MGED and Archer. This command pops up a graph based visualization window of the currently opened .g database. Its documentation can be found in ''brlman''.<br />
<br />
As an example, here is how the graph for the ''share/db/axis.g'' database looks like now:<br />
:[[Image:Graph_editor_v2.png]]<br />
<br />
Further work that can extend the ''interactive'' trait of the graph layout API includes adding user actions upon the graph such as ''move'' (dragging a node) or ''delete'' functionalities.<br />
<br />
==== Ksenija Slivko: Reducing Code ====<br />
<br />
===== Abstract =====<br />
The main aim of this project was to decrease the number of lines of code in the project. Since the project is being developing for quite a long time there were many "copy-pastes". They were redacted. <br />
<br />
===== The process of developing =====<br />
Coding period can be divided into three parts:<br />
* reduction in the single files<br />
* reduction in different files in the single program or library<br />
* reduction in different libraries<br />
<br />
===== Improving =====<br />
Since the project is quite large the redaction can be continued<br />
<br />
==== Laijiren: NURBS Tessellation: What, Why, How? ====<br />
===== Abstract =====<br />
Non-Uniform Rational B-Spline surfaces are widely used in CAD system. But they are not suitable for direct visualization on modern GPU systems. Today’s graphics hardware supports the high-speed display of polygonal objects consisting of triangles. This means that analytical surfaces (like NURBS) need to be triangulated so they can be displayed by 3D graphics cards.<br />
<br />
===== Main work =====<br />
*add 'info TB' 'info SB' to display information of piecewise bezier trim curve<br />
*add 'info T' 'info E' to display information of trim curve in parameter region and edge in 3d region<br />
*add 'plot SCV' to display control point net and 'plot TESS' to display the result of tessallation<br />
<br />
==== Suryajith Chillara: Benchmark Performance Database ====<br />
===== Abstract =====<br />
The main idea is to store the data both in the database and the log files stored in the archive. The storage in the database enables the content to be searched via the parameters such as machine descriptions, versions, results and could be compared. The storage as a file in the archive is to maintain a back up of the file and whenever a developer needs a specific bunch of benchmark logs, he could get them from the archive with or without the help of the database.<br />
<br />
===== Main Components =====<br />
* '''Log Parser :''' The data of the log file needs to be parsed and the relevant and important information has to be logged in the database so as to make the data access for the graphic display through the frontend could be made possible. <br />
* '''Web API :''' Implemented via the bottle framework so as to submit the logs from the brlcad installation via scripts.<br />
* '''Web backend :''' A backend has been implemented as a MVC framework from scratch using the python bottle framework. <br />
* '''Frontend :''' The website that can offer multiple mechanisms for adding new performance run data into the database and provide multiple graphical and non-graphical visualizations of aggregate performance data (i.e., graphs, charts, tables, etc). Graphs, tables and charts are generated with the help of Google Charts via wrapper which generates the javascript code to interact with the Google Charts service.<br />
[[Image:Absavgperfvsimagescomb.png]]<br />
<br />
<br />
Plumbing between these components is via the python scripts. <br />
<br />
<br />
===== Tool & Service dependancies =====<br />
* Python 2.7 and libraries<br />
* Bottle web framework<br />
* MySQL<br />
* Google Charts<br />
<br />
==== Wu Jianbang: NURBS surface-surface intersections ====<br />
I focused on the "NURBS surface-surface intersections" project after the mid-term evaluation of this year's GSoC, before which I worked on converting implicit primitives to NURBS B-rep forms.<br />
<br />
The function calculating NURBS surface-surface intersection curves is surface_surface_intersection() which is declared in include/nurbs.h and implemented in src/libnurbs/opennurbs_ext.cpp. It outputs intersection curves in 3d space and in both surfaces' UV parameter spaces.<br />
<br />
The approach of the algorithm originates from:<br />
<br />
Adarsh Krishnamurthy, Rahul Khardekar, Sara McMains, Kirk Haller, and Gershon Elber. 2008. Performing efficient NURBS modeling operations on the GPU. In Proceedings of the 2008 ACM symposium on Solid and physical modeling (SPM '08). ACM, New York, NY, USA, 257-268. DOI=10.1145/1364901.1364937 http://doi.acm.org/10.1145/1364901.1364937<br />
<br />
It can be divided into several steps:<br />
<br />
* Generate the bounding box of the two surfaces.<br />
* If their bounding boxes intersect:<br />
** Split the two surfaces, both into four parts, and calculate the sub-surfaces' bounding boxes<br />
** Calculate the intersection of sub-surfaces' bboxes, if they do intersect, go deeper with splitting surfaces and smaller bboxes, otherwise trace back.<br />
* After getting the intersecting bboxes, approximate the surface inside the bbox with two triangles, and calculate the intersection points of the triangles (both in 3d space and two surfaces' UV space)<br />
* Fit the intersection points into polyline curves, and then to NURBS curves. Points with distance less than max_dis are considered in one curve.<br />
<br />
It needs to be mentioned here that the value max_dis can be provided by the user or generated automatically.<br />
<br />
Besides, after calculating the intersection curves, the next steps towords evaluated NURBS are splitting the surfaces into sub-surfaces with the intersection curves as their boundaries, and some inside-outside tests to decide which sub-surfaces should be included in the final object. Some work on splitting has been done, generating some b-rep faces that can pass IsValid(), but still further work is needed.<br />
<br />
==== Andrei Popescu: Network Performance Testing ====<br />
<br />
The project that I have been working on during the summer, as part of the Google Summer of Code program,<br> can be broken down into three independent parts and it consisted in running various tests for the BRL-CAD<br> networking library(Libpkg) .<br />
<br />
*Speed testing and investigations to uncover any potential performance bottleneck.<br />
*Unit tests and code review to find and cover any untreated exceptions(crashes) in the Libpkg library.<br />
*Eliminate the assumption of globals in the API.<br />
<br />
For the first part, I have run two types of tests : <br><br />
<br />
Local ones, both the "sender" and the "receiver" were located on localhost.<br />
The script gathered data<br> regarding the transmission speed for each set of package sizes (Here, package refers to the package <br>created by networking library, not networking packages) respectively file sizes.<br />
<br />
Remote ones, where the "sender" and the "receiver" were on separate machines, connected using SSH.<br> The script ran and the data gathered was done in the same way as the localhost one.Using the data <br> obtained from the tests, two 3D graphs were drawn.However, the tests were inconclusive, I could not find<br> an "ideal" package size to use regardless of file size.<br />
<br />
After Mid-term I focused mostly on second part. I used test units from libbu(Utility library) as an example<br> for the unit test type and design.<br />
When the mentioned tests were run, several exceptions that caused<br> crashes were discovered. Lastly, I have written fixes for the discovered crashes.<br />
<br />
The third part of the project has not been covered yet, so more work is needed.Although, I am doing my<br> best to finish it in the following weeks.<br />
<br />
==== Chris Dueck: Calculating 2D Sketch Surface Area ====<br />
<br />
Calculating the surface area of a 2D Sketch primitive is not a trivial task. Sketches are created interactively by the user, and can contain straight line segments, circular arc segments (and full circles), as well as Bezier and NURBS curves.<br />
<br />
The method used to approximately compute the area of a 2D sketch is as follows:<br />
<br />
*1.) Approximate the sketch by a polygon<br />
*2.) Compute the area of the polygon exactly using Green's Theorem<br />
*3.) Add the areas of any circular arc segments that were created during (1)<br />
<br />
To approximate the sketch by a polygon, each possible curve type of a sketch must be considered.<br />
<br />
*If the curve is a straight line, it need not be approximated.<br />
<br />
*If the curve is a circular arc, it must be determined if it is a full circle (in which case its area can be computed easily) or if it is a circular arc segment. If it is a circular arc segment, the line segment from the beginning of the arc to the endpoint is added to the polygon, and the excess area of the circular arc segment itself can be calculated easily (https://en.wikipedia.org/wiki/Circular_segment)<br />
<br />
*If the curve is a Bezier curve, it can be approximated by a series of circular arcs. The algorithm used can be found here (http://itc.ktu.lt/itc354/Riskus354.pdf). The algorithm recursively subdivides the Bezier until it is approximated to tolerance by a biarc and uses the curvature value of the Bezier at a point to determine the depth of subdivision. Then each circular arc in the approximation of the Bezier curve is treated as above.<br />
<br />
Finally, the area of the polygon can be efficiently calculated using Green's Theorem (http://www.softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#3D%20Standard%20Formula) using cross products.<br />
<br />
==== Cliff Yapp: NURBS Ray Tracing in BRL-CAD ====<br />
<br />
Over the past year, an intense development effort by BRL-CAD's development team has successfully implemented raytracing of Non-Uniform Rational BSpline (NURBS) geometry within the BRL-CAD Computer-Aided Design (CAD) package. NURBS surfaces are very general, very complex mathematical shapes used by virtually all modern commercial CAD software packages. Because BRL-CAD did not originally support this type of geometry, commercial models could only be imported into BRL-CAD after a labor-intensive and difficult conversion process from NURBS form to triangle-base geometry (referred to in BRL-CAD as Bags-of-Triangles or BoTs). The new NURBS raytracing capability builds on work by many developers over a period of years, who in turn built on the open source library OpenNURBS. Support for this primitive type means BRL-CAD can now store and raytrace data from commercial models without requiring preliminary conversion to another type of geometry.<br />
<br />
The last major feature needed to make import of commercial models in BRL-CAD straightforward is conversion support for ISO’s "Standard for the Exchange of Product model data" or STEP file format. STEP uses NURBS geometry in its definition, making support for NURBS geometry a necessary prelude to support for STEP import. Most commercial CAD modelers support this file format as an output option, hence STEP support in BRL-CAD would allow a direct path for moving geometric descriptions from a variety of commercial modelers to BRL-CAD. Considerable progress has already been made on STEP import support, but more work is need to bring the code and feature set to "production quality". If anyone would like to join the BRL-CAD open source development effort and has a little familiarity with C++, the step-g converter and its supporting libraries have some simple-yet-useful tasks that would be an excellent and very useful way to explore the project - join BRL-CAD's IRC channel or development email list if you are interested!<br />
<br />
==== Erik Greenwald: Bolting ADRT's libtie under the hood ====<br />
<br />
[[Image:BoTvsTie.png|right|thumb|256px|BoT vs Tie pixdiff]]<br />
<br />
Initial progress on the integration of ADRT's libtie "triangle intersection engine" with LIBRT.<br />
<br />
----<br />
<br />
== Idea Hopper ==<br />
These are ideas for interesting or useful publications. We need someone to at least write a draft.<br />
<br />
==== BRL-CAD's Evolutionary API ====<br />
<br />
Talk about BRL-CAD deprecation process.<br />
<br />
==== Introduction to new .deb and .rpm builds ====<br />
<br />
Brief article overviewing the efforts by jordisayol for Debian, Ubuntu, Fedora, and openSUSE. Included are new icons, menu items, mime type associations, and more.<br />
<br />
==== 2010 End Of Year Review ====<br />
<br />
Article giving an overview of the past year's highlight developments with hints at what 2011 may bring. Alternatively, may be the annual statistics review if we switch from fiscal to calendar year reporting.<br />
<br />
==== Erik Greenwald: ADRT/ISST Visualization ====<br />
<br />
Article introducing ADRT/ISST core capability.<br />
<br />
==== Bob Parker: Alpha Archer: Working Towards Next Generation MGED ====<br />
<br />
Article introducing Archer's core new features that will be "coming" to MGED. Undo, interactive editing, tree view, and info panels come to mind.<br />
<br />
==== Finding the Hot Spots ====<br />
<br />
Article on the rt lighting model Stephen Kennedy developed that visualizes the time spent per-pixel.<br />
<br />
==== Point Clouds ====<br />
<br />
Article introducing the new point cloud primitive.<br />
<br />
==== bn_mat_inv: singular matrix ====<br />
<br />
Article on the v4 format and binary compatibility.<br />
<br />
==== Model Showcase: Goliath ====<br />
<br />
Article talking about the making of the Goliath model.<br />
<br />
==== Model Showcase: Chumaciera ====<br />
<br />
Article on Pedro Baptista's bearing model.<br />
<br />
==== Model Showcase: Proyecto Catapulta ====<br />
<br />
Article on a model developed by André Santos, António Almeida, and Pedro Ferreira.<br />
<br />
==== Model Showcase: Union Coupling Tool ====<br />
<br />
Article on a model developed by Inês de Matos under teacher Luís Ferreira. The project focuses on a tool, union coupling, based on the book, http://purl.pt/14352 , page 122 of the original book and page 128 of the file, figures 108 and 109.<br />
<br />
==== Geometry Service FAQ ====<br />
<br />
FAQ summarization of the GS as it pertains to the wider open source community.<br />
<br />
==== BRL-CAD's 3rd Generation Build System ====<br />
<br />
Article on the new CMake build system.<br />
<br />
==== BRL-CAD's Open Source Vision ====<br />
<br />
Article introducing the Project Priorities diagram and overall project vision.<br />
<br />
==== BRL-CAD Primitives Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's primitives and their current status.<br />
<br />
==== BRL-CAD Geometry Converter Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's geometry converters.<br />
<br />
==== Release Schedule ====<br />
<br />
Explain our release schedule and versioning system.<br />
<br />
==== RTGL ====<br />
<br />
Article on Nick's point-based visualization mode.<br />
<br />
==== BRL-CAD Quick Reference Card ====<br />
<br />
Article on a BRL-CAD QRC similar to the existing MGED QRC.<br />
<br />
==== BRL-CAD Bibliography ====<br />
<br />
After the .bib gets published to the website, an article announcing it and soliciting additions.<br />
<br />
==== Revolve Primitive ====<br />
<br />
Article on Timothy Van Ruitenbeek's work implementing 'revolve'.<br />
<br />
==== Parametrics and Constraints ====<br />
<br />
Article on Dawn Thomas' work to integrate parametric equation and constraint evaluation support.<br />
<br />
==== Converting Implicit to Explicit: CSG to BREP NURBS ====<br />
<br />
Article on the work by Cliff Yapp, Joe Doliner, and Ben Poole converting primitives with an implicit representation into an explicit NURBS representation.<br />
<br />
==== Online Model Repository ====<br />
<br />
Article on Elena Băutu's work developing the model repository website.<br />
<br />
==== Project Statistics for 2010 ====<br />
<br />
Article on our current stats similar to previous years.<br />
<br />
==== Next Generation BRL-CAD ====<br />
<br />
Article on our super secret awesome new GUI.</div>Plussaihttps://brlcad.org/w/index.php?title=Community_Publication_Portal&diff=4590Community Publication Portal2012-11-15T08:14:27Z<p>Plussai: /* Abstract */</p>
<hr />
<div>Welcome to the BRL-CAD community publication portal. This page is dedicated to the preparation and editing of BRL-CAD announcements. Proposed and upcoming topics are listed. Anyone is '''welcome and encouraged''' to share news about any activity related to BRL-CAD. Community editing and review are encouraged.<br />
<br />
__TOC__<br />
<br />
'''Formatting & Editing Standards:'''<br />
<br />
* Quotations are italicized and placed between double quotes ('' "Like This" '').<br />
<br />
* AA (All Acronyms) need to be defined upon first use, don't abbrev. words.<br />
<br />
* Section headings uppercase the major words and are in bold ('''Like This''')<br />
<br />
* Use the serial comma: one, two, and three; not one, two and three.<br />
<br />
* Cite references, include hyperlinks.<br />
<br />
* Keep it brief.<br />
<br />
'''Distribution Channels:'''<br />
<br />
For release publications, follow [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING HACKING]. For everything else, distribute to the following:<br />
<br />
* brlcad-news@lists.sourceforge.net<br />
* http://brlcad.org/d/node/add/story<br />
* https://sourceforge.net/news/?group_id=105292<br />
* (optional) https://brlcad.org/wiki/<br />
* (optional) http://www.tenlinks.com/NEWS/tl_daily/submit_news.htm<br />
* (optional) http://upfrontezine.com<br />
<br />
----<br />
----<br />
<br />
== Ready for Publication ==<br />
These articles are ready for publication. Release notes should be posted after tarballs, ideally the last or first week of a month. Other publications should be scheduled one or two weeks later, ideally on the second or third week of the month.<br />
<br />
Note: if you see a comment indicating that a section is FROZEN, any changes you make in that section may go unnoticed as the article is being prepared for distribution. If you find errors in a FROZEN article, go ahead and correct the article but contact Sean (brlcad on freenode [[IRC]]) who may be able to incorporate changes during final publication.<br />
<br />
==== Move from Final Review to Here When Ready====<br />
<br />
<br />
----<br />
<br />
== Final Editorial Review ==<br />
These should be "complete" articles. The author is done. All that remains is a structure, grammar, voice, punctuation, and spelling review. Images welcome.<br />
<br />
==== Kyle Bodt: Ronja ====<br />
<br />
http://brlcad.org/wiki/Ronja<br />
<br />
Ronja (Reasonable Optical Near Joint Access) is an innovative piece of equipment that utilizes reliable optical data links to create a current communication range of 1.4 km and a speed of 10Mbps full duplex that can be used as a general purpose wireless link for virtually any networking project. This is a very important project for Twibright Labs, a small group of computer science graduate students operating out of Charles University in Prague in the Czech Republic. The group specializes in the usage of Free Software and User Controlled Technology Development.<br />
<br />
The primary output for the Ronja project is a design. The lab does not intend to manufacture and sell the hardware that is being designed but wants to engage in open source development of the technology. The philosophy surrounding User Controlled Technology is the ideal that the end-user is provided with unrestricted access to the intellectual property surrounding the technology, including the tools that are being used to create it. One tool playing an integral part in the development of the Ronja designs is BRL-CAD. All of the models that Twibright labs use to display the different variants of their Ronja concept were created with the help of BRL-CAD. BRL-CAD has allowed the members of Twibright labs to create instructional diagrams so that the users and builders of their open source technology will be able to have the latest information with regard to the proper construction of a Ronja unit. The interactive geometry editor and ray-tracers in BRL-CAD are an integral part in the communication of design plans for Twibright labs and enables them to connect with the users, who are the driving force behind the User Controlled Technology ideal.<br />
<br />
----<br />
<br />
== Initial Drafts ==<br />
These are incomplete articles being worked on. Short 250 to 500-word articles (not counting tables, images, etc) are usually perfect.<br />
<br />
==== Anurag Murty: Voxelizing Geometry ====<br />
Given a set of primitives as input, the voxelize command uses the data obtained from BRL-CAD's raytracer to represent the input in the form of voxels(Volumetric Picture Elements). A uniform grid of rays is uniformly shot on the given input and an approximation of the volume filled in each voxel region is made from the raytracing data. Depending on the approximate volume of the voxel filled, a voxel is classified as IN or OUT of the voxelized output. The voxels are represented as RPPs. <br />
Such voxelized outputs have applications in Volumetric rendering and finite element analysis.<br />
<br />
SYNTAX : <br />
voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]<br />
<br />
ARGUMENTS-<br />
<br />
-d - Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values<br />
<br />
-s - Specifies the voxel size in each direction. <br />
<br />
-t - Specifies the threshold volume to decide if voxel is to be included in the voxelized output. <br />
<br />
new_obj - Name for resultant primitive that is a region containing the resulting voxels. <br />
<br />
old_obj - Name of source primitive or collection.<br />
<br />
<br />
NOTES- <br />
<br />
1. A greater level of detail usually implies a much better approximation of fill volumes at the cost of more computations.<br />
<br />
2. Lesser voxel sizes give a more precise representation of the input at the cost of more memory requirements.<br />
<br />
3. Threshold value (the argument of -t) should be a value between 0 and 1, and not a percentage.<br />
<br />
==== Cristina Precup: Visualizing Directed Acyclic Graphs ====<br />
'''Visualizing Constructive Solid Geometry''' is a project meant to illustrate in an intuitive and interactive manner the hierarchical structure of .g geometry databases.<br />
<br />
For the representation of the hierarchies, the '''Adaptagrams''' graph library has been used. This made possible organizing the objects contained within the database into directed acyclic graphs.<br />
<br />
Following, are the steps that have been taken in developing the graph layout API:<br />
<br />
* Integrate the Adaptagrams library into BRL-CAD.<br />
* Traverse the geometry database and distinguish different types of objects (''primitive'', ''combination'', ''non-geometry'') within it, as well as, establish the operations between them (''union'', ''difference'', ...). Add all this data to the graph structure constructed with Adaptagrams.<br />
* Display the objects using a Tk Canvas widget inside a window.<br />
* Develop a ''decorative routine'' that sets different colors for different types of objects, correspondingly.<br />
* Create a name label for each represented object.<br />
* Develop a layout algorithm that aligns the nodes of the graph in a hierarchical way.<br />
* Introduce the '''graph''' command in both '''MGED''' and '''Archer'''. It has two subcommands:<br />
** '''show''' which displays a list with the name and type of the objects along with the nodes' and edges' positions;<br />
** '''positions''' that lists the names, types and positions of the corresponding nodes within the graph;<br />
* Introduce the '''igraph''' command in both MGED and Archer. This command pops up a graph based visualization window of the currently opened .g database. Its documentation can be found in ''brlman''.<br />
<br />
As an example, here is how the graph for the ''share/db/axis.g'' database looks like now:<br />
:[[Image:Graph_editor_v2.png]]<br />
<br />
Further work that can extend the ''interactive'' trait of the graph layout API includes adding user actions upon the graph such as ''move'' (dragging a node) or ''delete'' functionalities.<br />
<br />
==== Ksenija Slivko: Reducing Code ====<br />
<br />
===== Abstract =====<br />
The main aim of this project was to decrease the number of lines of code in the project. Since the project is being developing for quite a long time there were many "copy-pastes". They were redacted. <br />
<br />
===== The process of developing =====<br />
Coding period can be divided into three parts:<br />
* reduction in the single files<br />
* reduction in different files in the single program or library<br />
* reduction in different libraries<br />
<br />
===== Improving =====<br />
Since the project is quite large the redaction can be continued<br />
<br />
==== Laijiren: NURBS Tessellation: What, Why, How? ====<br />
===== Abstract =====<br />
Non-Uniform Rational B-Spline surfaces are widely used in CAD system. But they are not suitable for direct visualization on modern GPU systems. Today’s graphics hardware supports the high-speed display of polygonal objects consisting of triangles. This means that analytical surfaces (like NURBS) need to be triangulated so they can be displayed by 3D graphics cards.<br />
<br />
===== Main Components =====<br />
<br />
==== Suryajith Chillara: Benchmark Performance Database ====<br />
===== Abstract =====<br />
The main idea is to store the data both in the database and the log files stored in the archive. The storage in the database enables the content to be searched via the parameters such as machine descriptions, versions, results and could be compared. The storage as a file in the archive is to maintain a back up of the file and whenever a developer needs a specific bunch of benchmark logs, he could get them from the archive with or without the help of the database.<br />
<br />
===== Main Components =====<br />
* '''Log Parser :''' The data of the log file needs to be parsed and the relevant and important information has to be logged in the database so as to make the data access for the graphic display through the frontend could be made possible. <br />
* '''Web API :''' Implemented via the bottle framework so as to submit the logs from the brlcad installation via scripts.<br />
* '''Web backend :''' A backend has been implemented as a MVC framework from scratch using the python bottle framework. <br />
* '''Frontend :''' The website that can offer multiple mechanisms for adding new performance run data into the database and provide multiple graphical and non-graphical visualizations of aggregate performance data (i.e., graphs, charts, tables, etc). Graphs, tables and charts are generated with the help of Google Charts via wrapper which generates the javascript code to interact with the Google Charts service.<br />
[[Image:Absavgperfvsimagescomb.png]]<br />
<br />
<br />
Plumbing between these components is via the python scripts. <br />
<br />
<br />
===== Tool & Service dependancies =====<br />
* Python 2.7 and libraries<br />
* Bottle web framework<br />
* MySQL<br />
* Google Charts<br />
<br />
==== Wu Jianbang: NURBS surface-surface intersections ====<br />
I focused on the "NURBS surface-surface intersections" project after the mid-term evaluation of this year's GSoC, before which I worked on converting implicit primitives to NURBS B-rep forms.<br />
<br />
The function calculating NURBS surface-surface intersection curves is surface_surface_intersection() which is declared in include/nurbs.h and implemented in src/libnurbs/opennurbs_ext.cpp. It outputs intersection curves in 3d space and in both surfaces' UV parameter spaces.<br />
<br />
The approach of the algorithm originates from:<br />
<br />
Adarsh Krishnamurthy, Rahul Khardekar, Sara McMains, Kirk Haller, and Gershon Elber. 2008. Performing efficient NURBS modeling operations on the GPU. In Proceedings of the 2008 ACM symposium on Solid and physical modeling (SPM '08). ACM, New York, NY, USA, 257-268. DOI=10.1145/1364901.1364937 http://doi.acm.org/10.1145/1364901.1364937<br />
<br />
It can be divided into several steps:<br />
<br />
* Generate the bounding box of the two surfaces.<br />
* If their bounding boxes intersect:<br />
** Split the two surfaces, both into four parts, and calculate the sub-surfaces' bounding boxes<br />
** Calculate the intersection of sub-surfaces' bboxes, if they do intersect, go deeper with splitting surfaces and smaller bboxes, otherwise trace back.<br />
* After getting the intersecting bboxes, approximate the surface inside the bbox with two triangles, and calculate the intersection points of the triangles (both in 3d space and two surfaces' UV space)<br />
* Fit the intersection points into polyline curves, and then to NURBS curves. Points with distance less than max_dis are considered in one curve.<br />
<br />
It needs to be mentioned here that the value max_dis can be provided by the user or generated automatically.<br />
<br />
Besides, after calculating the intersection curves, the next steps towords evaluated NURBS are splitting the surfaces into sub-surfaces with the intersection curves as their boundaries, and some inside-outside tests to decide which sub-surfaces should be included in the final object. Some work on splitting has been done, generating some b-rep faces that can pass IsValid(), but still further work is needed.<br />
<br />
==== Andrei Popescu: Network Performance Testing ====<br />
<br />
The project that I have been working on during the summer, as part of the Google Summer of Code program,<br> can be broken down into three independent parts and it consisted in running various tests for the BRL-CAD<br> networking library(Libpkg) .<br />
<br />
*Speed testing and investigations to uncover any potential performance bottleneck.<br />
*Unit tests and code review to find and cover any untreated exceptions(crashes) in the Libpkg library.<br />
*Eliminate the assumption of globals in the API.<br />
<br />
For the first part, I have run two types of tests : <br><br />
<br />
Local ones, both the "sender" and the "receiver" were located on localhost.<br />
The script gathered data<br> regarding the transmission speed for each set of package sizes (Here, package refers to the package <br>created by networking library, not networking packages) respectively file sizes.<br />
<br />
Remote ones, where the "sender" and the "receiver" were on separate machines, connected using SSH.<br> The script ran and the data gathered was done in the same way as the localhost one.Using the data <br> obtained from the tests, two 3D graphs were drawn.However, the tests were inconclusive, I could not find<br> an "ideal" package size to use regardless of file size.<br />
<br />
After Mid-term I focused mostly on second part. I used test units from libbu(Utility library) as an example<br> for the unit test type and design.<br />
When the mentioned tests were run, several exceptions that caused<br> crashes were discovered. Lastly, I have written fixes for the discovered crashes.<br />
<br />
The third part of the project has not been covered yet, so more work is needed.Although, I am doing my<br> best to finish it in the following weeks.<br />
<br />
==== Chris Dueck: Calculating 2D Sketch Surface Area ====<br />
<br />
Calculating the surface area of a 2D Sketch primitive is not a trivial task. Sketches are created interactively by the user, and can contain straight line segments, circular arc segments (and full circles), as well as Bezier and NURBS curves.<br />
<br />
The method used to approximately compute the area of a 2D sketch is as follows:<br />
<br />
*1.) Approximate the sketch by a polygon<br />
*2.) Compute the area of the polygon exactly using Green's Theorem<br />
*3.) Add the areas of any circular arc segments that were created during (1)<br />
<br />
To approximate the sketch by a polygon, each possible curve type of a sketch must be considered.<br />
<br />
*If the curve is a straight line, it need not be approximated.<br />
<br />
*If the curve is a circular arc, it must be determined if it is a full circle (in which case its area can be computed easily) or if it is a circular arc segment. If it is a circular arc segment, the line segment from the beginning of the arc to the endpoint is added to the polygon, and the excess area of the circular arc segment itself can be calculated easily (https://en.wikipedia.org/wiki/Circular_segment)<br />
<br />
*If the curve is a Bezier curve, it can be approximated by a series of circular arcs. The algorithm used can be found here (http://itc.ktu.lt/itc354/Riskus354.pdf). The algorithm recursively subdivides the Bezier until it is approximated to tolerance by a biarc and uses the curvature value of the Bezier at a point to determine the depth of subdivision. Then each circular arc in the approximation of the Bezier curve is treated as above.<br />
<br />
Finally, the area of the polygon can be efficiently calculated using Green's Theorem (http://www.softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#3D%20Standard%20Formula) using cross products.<br />
<br />
==== Cliff Yapp: NURBS Ray Tracing in BRL-CAD ====<br />
<br />
Over the past year, an intense development effort by BRL-CAD's development team has successfully implemented raytracing of Non-Uniform Rational BSpline (NURBS) geometry within the BRL-CAD Computer-Aided Design (CAD) package. NURBS surfaces are very general, very complex mathematical shapes used by virtually all modern commercial CAD software packages. Because BRL-CAD did not originally support this type of geometry, commercial models could only be imported into BRL-CAD after a labor-intensive and difficult conversion process from NURBS form to triangle-base geometry (referred to in BRL-CAD as Bags-of-Triangles or BoTs). The new NURBS raytracing capability builds on work by many developers over a period of years, who in turn built on the open source library OpenNURBS. Support for this primitive type means BRL-CAD can now store and raytrace data from commercial models without requiring preliminary conversion to another type of geometry.<br />
<br />
The last major feature needed to make import of commercial models in BRL-CAD straightforward is conversion support for ISO’s "Standard for the Exchange of Product model data" or STEP file format. STEP uses NURBS geometry in its definition, making support for NURBS geometry a necessary prelude to support for STEP import. Most commercial CAD modelers support this file format as an output option, hence STEP support in BRL-CAD would allow a direct path for moving geometric descriptions from a variety of commercial modelers to BRL-CAD. Considerable progress has already been made on STEP import support, but more work is need to bring the code and feature set to "production quality". If anyone would like to join the BRL-CAD open source development effort and has a little familiarity with C++, the step-g converter and its supporting libraries have some simple-yet-useful tasks that would be an excellent and very useful way to explore the project - join BRL-CAD's IRC channel or development email list if you are interested!<br />
<br />
==== Erik Greenwald: Bolting ADRT's libtie under the hood ====<br />
<br />
[[Image:BoTvsTie.png|right|thumb|256px|BoT vs Tie pixdiff]]<br />
<br />
Initial progress on the integration of ADRT's libtie "triangle intersection engine" with LIBRT.<br />
<br />
----<br />
<br />
== Idea Hopper ==<br />
These are ideas for interesting or useful publications. We need someone to at least write a draft.<br />
<br />
==== BRL-CAD's Evolutionary API ====<br />
<br />
Talk about BRL-CAD deprecation process.<br />
<br />
==== Introduction to new .deb and .rpm builds ====<br />
<br />
Brief article overviewing the efforts by jordisayol for Debian, Ubuntu, Fedora, and openSUSE. Included are new icons, menu items, mime type associations, and more.<br />
<br />
==== 2010 End Of Year Review ====<br />
<br />
Article giving an overview of the past year's highlight developments with hints at what 2011 may bring. Alternatively, may be the annual statistics review if we switch from fiscal to calendar year reporting.<br />
<br />
==== Erik Greenwald: ADRT/ISST Visualization ====<br />
<br />
Article introducing ADRT/ISST core capability.<br />
<br />
==== Bob Parker: Alpha Archer: Working Towards Next Generation MGED ====<br />
<br />
Article introducing Archer's core new features that will be "coming" to MGED. Undo, interactive editing, tree view, and info panels come to mind.<br />
<br />
==== Finding the Hot Spots ====<br />
<br />
Article on the rt lighting model Stephen Kennedy developed that visualizes the time spent per-pixel.<br />
<br />
==== Point Clouds ====<br />
<br />
Article introducing the new point cloud primitive.<br />
<br />
==== bn_mat_inv: singular matrix ====<br />
<br />
Article on the v4 format and binary compatibility.<br />
<br />
==== Model Showcase: Goliath ====<br />
<br />
Article talking about the making of the Goliath model.<br />
<br />
==== Model Showcase: Chumaciera ====<br />
<br />
Article on Pedro Baptista's bearing model.<br />
<br />
==== Model Showcase: Proyecto Catapulta ====<br />
<br />
Article on a model developed by André Santos, António Almeida, and Pedro Ferreira.<br />
<br />
==== Model Showcase: Union Coupling Tool ====<br />
<br />
Article on a model developed by Inês de Matos under teacher Luís Ferreira. The project focuses on a tool, union coupling, based on the book, http://purl.pt/14352 , page 122 of the original book and page 128 of the file, figures 108 and 109.<br />
<br />
==== Geometry Service FAQ ====<br />
<br />
FAQ summarization of the GS as it pertains to the wider open source community.<br />
<br />
==== BRL-CAD's 3rd Generation Build System ====<br />
<br />
Article on the new CMake build system.<br />
<br />
==== BRL-CAD's Open Source Vision ====<br />
<br />
Article introducing the Project Priorities diagram and overall project vision.<br />
<br />
==== BRL-CAD Primitives Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's primitives and their current status.<br />
<br />
==== BRL-CAD Geometry Converter Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's geometry converters.<br />
<br />
==== Release Schedule ====<br />
<br />
Explain our release schedule and versioning system.<br />
<br />
==== RTGL ====<br />
<br />
Article on Nick's point-based visualization mode.<br />
<br />
==== BRL-CAD Quick Reference Card ====<br />
<br />
Article on a BRL-CAD QRC similar to the existing MGED QRC.<br />
<br />
==== BRL-CAD Bibliography ====<br />
<br />
After the .bib gets published to the website, an article announcing it and soliciting additions.<br />
<br />
==== Revolve Primitive ====<br />
<br />
Article on Timothy Van Ruitenbeek's work implementing 'revolve'.<br />
<br />
==== Parametrics and Constraints ====<br />
<br />
Article on Dawn Thomas' work to integrate parametric equation and constraint evaluation support.<br />
<br />
==== Converting Implicit to Explicit: CSG to BREP NURBS ====<br />
<br />
Article on the work by Cliff Yapp, Joe Doliner, and Ben Poole converting primitives with an implicit representation into an explicit NURBS representation.<br />
<br />
==== Online Model Repository ====<br />
<br />
Article on Elena Băutu's work developing the model repository website.<br />
<br />
==== Project Statistics for 2010 ====<br />
<br />
Article on our current stats similar to previous years.<br />
<br />
==== Next Generation BRL-CAD ====<br />
<br />
Article on our super secret awesome new GUI.</div>Plussaihttps://brlcad.org/w/index.php?title=Community_Publication_Portal&diff=4589Community Publication Portal2012-11-15T08:12:12Z<p>Plussai: /* Laijiren: NURBS Tessellation: What, Why, How? */</p>
<hr />
<div>Welcome to the BRL-CAD community publication portal. This page is dedicated to the preparation and editing of BRL-CAD announcements. Proposed and upcoming topics are listed. Anyone is '''welcome and encouraged''' to share news about any activity related to BRL-CAD. Community editing and review are encouraged.<br />
<br />
__TOC__<br />
<br />
'''Formatting & Editing Standards:'''<br />
<br />
* Quotations are italicized and placed between double quotes ('' "Like This" '').<br />
<br />
* AA (All Acronyms) need to be defined upon first use, don't abbrev. words.<br />
<br />
* Section headings uppercase the major words and are in bold ('''Like This''')<br />
<br />
* Use the serial comma: one, two, and three; not one, two and three.<br />
<br />
* Cite references, include hyperlinks.<br />
<br />
* Keep it brief.<br />
<br />
'''Distribution Channels:'''<br />
<br />
For release publications, follow [http://brlcad.svn.sourceforge.net/viewvc/brlcad/brlcad/trunk/HACKING HACKING]. For everything else, distribute to the following:<br />
<br />
* brlcad-news@lists.sourceforge.net<br />
* http://brlcad.org/d/node/add/story<br />
* https://sourceforge.net/news/?group_id=105292<br />
* (optional) https://brlcad.org/wiki/<br />
* (optional) http://www.tenlinks.com/NEWS/tl_daily/submit_news.htm<br />
* (optional) http://upfrontezine.com<br />
<br />
----<br />
----<br />
<br />
== Ready for Publication ==<br />
These articles are ready for publication. Release notes should be posted after tarballs, ideally the last or first week of a month. Other publications should be scheduled one or two weeks later, ideally on the second or third week of the month.<br />
<br />
Note: if you see a comment indicating that a section is FROZEN, any changes you make in that section may go unnoticed as the article is being prepared for distribution. If you find errors in a FROZEN article, go ahead and correct the article but contact Sean (brlcad on freenode [[IRC]]) who may be able to incorporate changes during final publication.<br />
<br />
==== Move from Final Review to Here When Ready====<br />
<br />
<br />
----<br />
<br />
== Final Editorial Review ==<br />
These should be "complete" articles. The author is done. All that remains is a structure, grammar, voice, punctuation, and spelling review. Images welcome.<br />
<br />
==== Kyle Bodt: Ronja ====<br />
<br />
http://brlcad.org/wiki/Ronja<br />
<br />
Ronja (Reasonable Optical Near Joint Access) is an innovative piece of equipment that utilizes reliable optical data links to create a current communication range of 1.4 km and a speed of 10Mbps full duplex that can be used as a general purpose wireless link for virtually any networking project. This is a very important project for Twibright Labs, a small group of computer science graduate students operating out of Charles University in Prague in the Czech Republic. The group specializes in the usage of Free Software and User Controlled Technology Development.<br />
<br />
The primary output for the Ronja project is a design. The lab does not intend to manufacture and sell the hardware that is being designed but wants to engage in open source development of the technology. The philosophy surrounding User Controlled Technology is the ideal that the end-user is provided with unrestricted access to the intellectual property surrounding the technology, including the tools that are being used to create it. One tool playing an integral part in the development of the Ronja designs is BRL-CAD. All of the models that Twibright labs use to display the different variants of their Ronja concept were created with the help of BRL-CAD. BRL-CAD has allowed the members of Twibright labs to create instructional diagrams so that the users and builders of their open source technology will be able to have the latest information with regard to the proper construction of a Ronja unit. The interactive geometry editor and ray-tracers in BRL-CAD are an integral part in the communication of design plans for Twibright labs and enables them to connect with the users, who are the driving force behind the User Controlled Technology ideal.<br />
<br />
----<br />
<br />
== Initial Drafts ==<br />
These are incomplete articles being worked on. Short 250 to 500-word articles (not counting tables, images, etc) are usually perfect.<br />
<br />
==== Anurag Murty: Voxelizing Geometry ====<br />
Given a set of primitives as input, the voxelize command uses the data obtained from BRL-CAD's raytracer to represent the input in the form of voxels(Volumetric Picture Elements). A uniform grid of rays is uniformly shot on the given input and an approximation of the volume filled in each voxel region is made from the raytracing data. Depending on the approximate volume of the voxel filled, a voxel is classified as IN or OUT of the voxelized output. The voxels are represented as RPPs. <br />
Such voxelized outputs have applications in Volumetric rendering and finite element analysis.<br />
<br />
SYNTAX : <br />
voxelize [-s "dx dy dz"] [-d n] [-t f] new_obj old_obj [old_obj2 old_obj3 ...]<br />
<br />
ARGUMENTS-<br />
<br />
-d - Specifies the level of detail(precision in approximation of volume) required. An input of n means that n * n rays will be shot through each row, and an approximation of volume filled is reached averaging these n * n values<br />
<br />
-s - Specifies the voxel size in each direction. <br />
<br />
-t - Specifies the threshold volume to decide if voxel is to be included in the voxelized output. <br />
<br />
new_obj - Name for resultant primitive that is a region containing the resulting voxels. <br />
<br />
old_obj - Name of source primitive or collection.<br />
<br />
<br />
NOTES- <br />
<br />
1. A greater level of detail usually implies a much better approximation of fill volumes at the cost of more computations.<br />
<br />
2. Lesser voxel sizes give a more precise representation of the input at the cost of more memory requirements.<br />
<br />
3. Threshold value (the argument of -t) should be a value between 0 and 1, and not a percentage.<br />
<br />
==== Cristina Precup: Visualizing Directed Acyclic Graphs ====<br />
'''Visualizing Constructive Solid Geometry''' is a project meant to illustrate in an intuitive and interactive manner the hierarchical structure of .g geometry databases.<br />
<br />
For the representation of the hierarchies, the '''Adaptagrams''' graph library has been used. This made possible organizing the objects contained within the database into directed acyclic graphs.<br />
<br />
Following, are the steps that have been taken in developing the graph layout API:<br />
<br />
* Integrate the Adaptagrams library into BRL-CAD.<br />
* Traverse the geometry database and distinguish different types of objects (''primitive'', ''combination'', ''non-geometry'') within it, as well as, establish the operations between them (''union'', ''difference'', ...). Add all this data to the graph structure constructed with Adaptagrams.<br />
* Display the objects using a Tk Canvas widget inside a window.<br />
* Develop a ''decorative routine'' that sets different colors for different types of objects, correspondingly.<br />
* Create a name label for each represented object.<br />
* Develop a layout algorithm that aligns the nodes of the graph in a hierarchical way.<br />
* Introduce the '''graph''' command in both '''MGED''' and '''Archer'''. It has two subcommands:<br />
** '''show''' which displays a list with the name and type of the objects along with the nodes' and edges' positions;<br />
** '''positions''' that lists the names, types and positions of the corresponding nodes within the graph;<br />
* Introduce the '''igraph''' command in both MGED and Archer. This command pops up a graph based visualization window of the currently opened .g database. Its documentation can be found in ''brlman''.<br />
<br />
As an example, here is how the graph for the ''share/db/axis.g'' database looks like now:<br />
:[[Image:Graph_editor_v2.png]]<br />
<br />
Further work that can extend the ''interactive'' trait of the graph layout API includes adding user actions upon the graph such as ''move'' (dragging a node) or ''delete'' functionalities.<br />
<br />
==== Ksenija Slivko: Reducing Code ====<br />
<br />
===== Abstract =====<br />
The main aim of this project was to decrease the number of lines of code in the project. Since the project is being developing for quite a long time there were many "copy-pastes". They were redacted. <br />
<br />
===== The process of developing =====<br />
Coding period can be divided into three parts:<br />
* reduction in the single files<br />
* reduction in different files in the single program or library<br />
* reduction in different libraries<br />
<br />
===== Improving =====<br />
Since the project is quite large the redaction can be continued<br />
<br />
==== Laijiren: NURBS Tessellation: What, Why, How? ====<br />
===== Abstract =====<br />
Non-Uniform Rational B-Spline surfaces are widely used in CAD system. But they are not suitable for direct visualization on modern GPU systems. Today’s graphics hardware supports the high-speed display of polygonal objects consisting of triangles. This means that analytical surfaces (like NURBS) need to be triangulated so they can be displayed by 3D graphics cards.<br />
<br />
==== Suryajith Chillara: Benchmark Performance Database ====<br />
===== Abstract =====<br />
The main idea is to store the data both in the database and the log files stored in the archive. The storage in the database enables the content to be searched via the parameters such as machine descriptions, versions, results and could be compared. The storage as a file in the archive is to maintain a back up of the file and whenever a developer needs a specific bunch of benchmark logs, he could get them from the archive with or without the help of the database.<br />
<br />
===== Main Components =====<br />
* '''Log Parser :''' The data of the log file needs to be parsed and the relevant and important information has to be logged in the database so as to make the data access for the graphic display through the frontend could be made possible. <br />
* '''Web API :''' Implemented via the bottle framework so as to submit the logs from the brlcad installation via scripts.<br />
* '''Web backend :''' A backend has been implemented as a MVC framework from scratch using the python bottle framework. <br />
* '''Frontend :''' The website that can offer multiple mechanisms for adding new performance run data into the database and provide multiple graphical and non-graphical visualizations of aggregate performance data (i.e., graphs, charts, tables, etc). Graphs, tables and charts are generated with the help of Google Charts via wrapper which generates the javascript code to interact with the Google Charts service.<br />
[[Image:Absavgperfvsimagescomb.png]]<br />
<br />
<br />
Plumbing between these components is via the python scripts. <br />
<br />
<br />
===== Tool & Service dependancies =====<br />
* Python 2.7 and libraries<br />
* Bottle web framework<br />
* MySQL<br />
* Google Charts<br />
<br />
==== Wu Jianbang: NURBS surface-surface intersections ====<br />
I focused on the "NURBS surface-surface intersections" project after the mid-term evaluation of this year's GSoC, before which I worked on converting implicit primitives to NURBS B-rep forms.<br />
<br />
The function calculating NURBS surface-surface intersection curves is surface_surface_intersection() which is declared in include/nurbs.h and implemented in src/libnurbs/opennurbs_ext.cpp. It outputs intersection curves in 3d space and in both surfaces' UV parameter spaces.<br />
<br />
The approach of the algorithm originates from:<br />
<br />
Adarsh Krishnamurthy, Rahul Khardekar, Sara McMains, Kirk Haller, and Gershon Elber. 2008. Performing efficient NURBS modeling operations on the GPU. In Proceedings of the 2008 ACM symposium on Solid and physical modeling (SPM '08). ACM, New York, NY, USA, 257-268. DOI=10.1145/1364901.1364937 http://doi.acm.org/10.1145/1364901.1364937<br />
<br />
It can be divided into several steps:<br />
<br />
* Generate the bounding box of the two surfaces.<br />
* If their bounding boxes intersect:<br />
** Split the two surfaces, both into four parts, and calculate the sub-surfaces' bounding boxes<br />
** Calculate the intersection of sub-surfaces' bboxes, if they do intersect, go deeper with splitting surfaces and smaller bboxes, otherwise trace back.<br />
* After getting the intersecting bboxes, approximate the surface inside the bbox with two triangles, and calculate the intersection points of the triangles (both in 3d space and two surfaces' UV space)<br />
* Fit the intersection points into polyline curves, and then to NURBS curves. Points with distance less than max_dis are considered in one curve.<br />
<br />
It needs to be mentioned here that the value max_dis can be provided by the user or generated automatically.<br />
<br />
Besides, after calculating the intersection curves, the next steps towords evaluated NURBS are splitting the surfaces into sub-surfaces with the intersection curves as their boundaries, and some inside-outside tests to decide which sub-surfaces should be included in the final object. Some work on splitting has been done, generating some b-rep faces that can pass IsValid(), but still further work is needed.<br />
<br />
==== Andrei Popescu: Network Performance Testing ====<br />
<br />
The project that I have been working on during the summer, as part of the Google Summer of Code program,<br> can be broken down into three independent parts and it consisted in running various tests for the BRL-CAD<br> networking library(Libpkg) .<br />
<br />
*Speed testing and investigations to uncover any potential performance bottleneck.<br />
*Unit tests and code review to find and cover any untreated exceptions(crashes) in the Libpkg library.<br />
*Eliminate the assumption of globals in the API.<br />
<br />
For the first part, I have run two types of tests : <br><br />
<br />
Local ones, both the "sender" and the "receiver" were located on localhost.<br />
The script gathered data<br> regarding the transmission speed for each set of package sizes (Here, package refers to the package <br>created by networking library, not networking packages) respectively file sizes.<br />
<br />
Remote ones, where the "sender" and the "receiver" were on separate machines, connected using SSH.<br> The script ran and the data gathered was done in the same way as the localhost one.Using the data <br> obtained from the tests, two 3D graphs were drawn.However, the tests were inconclusive, I could not find<br> an "ideal" package size to use regardless of file size.<br />
<br />
After Mid-term I focused mostly on second part. I used test units from libbu(Utility library) as an example<br> for the unit test type and design.<br />
When the mentioned tests were run, several exceptions that caused<br> crashes were discovered. Lastly, I have written fixes for the discovered crashes.<br />
<br />
The third part of the project has not been covered yet, so more work is needed.Although, I am doing my<br> best to finish it in the following weeks.<br />
<br />
==== Chris Dueck: Calculating 2D Sketch Surface Area ====<br />
<br />
Calculating the surface area of a 2D Sketch primitive is not a trivial task. Sketches are created interactively by the user, and can contain straight line segments, circular arc segments (and full circles), as well as Bezier and NURBS curves.<br />
<br />
The method used to approximately compute the area of a 2D sketch is as follows:<br />
<br />
*1.) Approximate the sketch by a polygon<br />
*2.) Compute the area of the polygon exactly using Green's Theorem<br />
*3.) Add the areas of any circular arc segments that were created during (1)<br />
<br />
To approximate the sketch by a polygon, each possible curve type of a sketch must be considered.<br />
<br />
*If the curve is a straight line, it need not be approximated.<br />
<br />
*If the curve is a circular arc, it must be determined if it is a full circle (in which case its area can be computed easily) or if it is a circular arc segment. If it is a circular arc segment, the line segment from the beginning of the arc to the endpoint is added to the polygon, and the excess area of the circular arc segment itself can be calculated easily (https://en.wikipedia.org/wiki/Circular_segment)<br />
<br />
*If the curve is a Bezier curve, it can be approximated by a series of circular arcs. The algorithm used can be found here (http://itc.ktu.lt/itc354/Riskus354.pdf). The algorithm recursively subdivides the Bezier until it is approximated to tolerance by a biarc and uses the curvature value of the Bezier at a point to determine the depth of subdivision. Then each circular arc in the approximation of the Bezier curve is treated as above.<br />
<br />
Finally, the area of the polygon can be efficiently calculated using Green's Theorem (http://www.softsurfer.com/Archive/algorithm_0101/algorithm_0101.htm#3D%20Standard%20Formula) using cross products.<br />
<br />
==== Cliff Yapp: NURBS Ray Tracing in BRL-CAD ====<br />
<br />
Over the past year, an intense development effort by BRL-CAD's development team has successfully implemented raytracing of Non-Uniform Rational BSpline (NURBS) geometry within the BRL-CAD Computer-Aided Design (CAD) package. NURBS surfaces are very general, very complex mathematical shapes used by virtually all modern commercial CAD software packages. Because BRL-CAD did not originally support this type of geometry, commercial models could only be imported into BRL-CAD after a labor-intensive and difficult conversion process from NURBS form to triangle-base geometry (referred to in BRL-CAD as Bags-of-Triangles or BoTs). The new NURBS raytracing capability builds on work by many developers over a period of years, who in turn built on the open source library OpenNURBS. Support for this primitive type means BRL-CAD can now store and raytrace data from commercial models without requiring preliminary conversion to another type of geometry.<br />
<br />
The last major feature needed to make import of commercial models in BRL-CAD straightforward is conversion support for ISO’s "Standard for the Exchange of Product model data" or STEP file format. STEP uses NURBS geometry in its definition, making support for NURBS geometry a necessary prelude to support for STEP import. Most commercial CAD modelers support this file format as an output option, hence STEP support in BRL-CAD would allow a direct path for moving geometric descriptions from a variety of commercial modelers to BRL-CAD. Considerable progress has already been made on STEP import support, but more work is need to bring the code and feature set to "production quality". If anyone would like to join the BRL-CAD open source development effort and has a little familiarity with C++, the step-g converter and its supporting libraries have some simple-yet-useful tasks that would be an excellent and very useful way to explore the project - join BRL-CAD's IRC channel or development email list if you are interested!<br />
<br />
==== Erik Greenwald: Bolting ADRT's libtie under the hood ====<br />
<br />
[[Image:BoTvsTie.png|right|thumb|256px|BoT vs Tie pixdiff]]<br />
<br />
Initial progress on the integration of ADRT's libtie "triangle intersection engine" with LIBRT.<br />
<br />
----<br />
<br />
== Idea Hopper ==<br />
These are ideas for interesting or useful publications. We need someone to at least write a draft.<br />
<br />
==== BRL-CAD's Evolutionary API ====<br />
<br />
Talk about BRL-CAD deprecation process.<br />
<br />
==== Introduction to new .deb and .rpm builds ====<br />
<br />
Brief article overviewing the efforts by jordisayol for Debian, Ubuntu, Fedora, and openSUSE. Included are new icons, menu items, mime type associations, and more.<br />
<br />
==== 2010 End Of Year Review ====<br />
<br />
Article giving an overview of the past year's highlight developments with hints at what 2011 may bring. Alternatively, may be the annual statistics review if we switch from fiscal to calendar year reporting.<br />
<br />
==== Erik Greenwald: ADRT/ISST Visualization ====<br />
<br />
Article introducing ADRT/ISST core capability.<br />
<br />
==== Bob Parker: Alpha Archer: Working Towards Next Generation MGED ====<br />
<br />
Article introducing Archer's core new features that will be "coming" to MGED. Undo, interactive editing, tree view, and info panels come to mind.<br />
<br />
==== Finding the Hot Spots ====<br />
<br />
Article on the rt lighting model Stephen Kennedy developed that visualizes the time spent per-pixel.<br />
<br />
==== Point Clouds ====<br />
<br />
Article introducing the new point cloud primitive.<br />
<br />
==== bn_mat_inv: singular matrix ====<br />
<br />
Article on the v4 format and binary compatibility.<br />
<br />
==== Model Showcase: Goliath ====<br />
<br />
Article talking about the making of the Goliath model.<br />
<br />
==== Model Showcase: Chumaciera ====<br />
<br />
Article on Pedro Baptista's bearing model.<br />
<br />
==== Model Showcase: Proyecto Catapulta ====<br />
<br />
Article on a model developed by André Santos, António Almeida, and Pedro Ferreira.<br />
<br />
==== Model Showcase: Union Coupling Tool ====<br />
<br />
Article on a model developed by Inês de Matos under teacher Luís Ferreira. The project focuses on a tool, union coupling, based on the book, http://purl.pt/14352 , page 122 of the original book and page 128 of the file, figures 108 and 109.<br />
<br />
==== Geometry Service FAQ ====<br />
<br />
FAQ summarization of the GS as it pertains to the wider open source community.<br />
<br />
==== BRL-CAD's 3rd Generation Build System ====<br />
<br />
Article on the new CMake build system.<br />
<br />
==== BRL-CAD's Open Source Vision ====<br />
<br />
Article introducing the Project Priorities diagram and overall project vision.<br />
<br />
==== BRL-CAD Primitives Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's primitives and their current status.<br />
<br />
==== BRL-CAD Geometry Converter Showcase ====<br />
<br />
Article summarizing all of BRL-CAD's geometry converters.<br />
<br />
==== Release Schedule ====<br />
<br />
Explain our release schedule and versioning system.<br />
<br />
==== RTGL ====<br />
<br />
Article on Nick's point-based visualization mode.<br />
<br />
==== BRL-CAD Quick Reference Card ====<br />
<br />
Article on a BRL-CAD QRC similar to the existing MGED QRC.<br />
<br />
==== BRL-CAD Bibliography ====<br />
<br />
After the .bib gets published to the website, an article announcing it and soliciting additions.<br />
<br />
==== Revolve Primitive ====<br />
<br />
Article on Timothy Van Ruitenbeek's work implementing 'revolve'.<br />
<br />
==== Parametrics and Constraints ====<br />
<br />
Article on Dawn Thomas' work to integrate parametric equation and constraint evaluation support.<br />
<br />
==== Converting Implicit to Explicit: CSG to BREP NURBS ====<br />
<br />
Article on the work by Cliff Yapp, Joe Doliner, and Ben Poole converting primitives with an implicit representation into an explicit NURBS representation.<br />
<br />
==== Online Model Repository ====<br />
<br />
Article on Elena Băutu's work developing the model repository website.<br />
<br />
==== Project Statistics for 2010 ====<br />
<br />
Article on our current stats similar to previous years.<br />
<br />
==== Next Generation BRL-CAD ====<br />
<br />
Article on our super secret awesome new GUI.</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4531User:Plussai/GSoC 2012 log2012-10-28T13:31:41Z<p>Plussai: /* 1 Augest 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
[[Image:brep.jpg]] <br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,algorithm has the steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
<br />
d)come to (a) until there only exists three points in the linked list<br />
<br />
=== 12 July 2012 ===<br />
*Update my patches.<br />
<br />
==''Week 10''==<br />
<br />
=== 1 Augest 2012 ===<br />
*because of pressure of my paper schedule, I need to leave for a long time.I must<br />
say sorry that I will not complete the final-evaluation for gsoc.<br />
<br />
==''Week 11''==<br />
<br />
=== 6 Augest 2012 ===<br />
*I'v package my patch into three part after cleaning up and adding some comments.<br />
I think the subdividion is OK some more test must be done to ensure my trimming algorithm is accurate enough.<br />
*because of large amount of code need to be cleaned up and test but time is up, I decide to handle my paper firstly.<br />
*But I will come back and complete my work finally.</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4530User:Plussai/GSoC 2012 log2012-10-28T13:24:45Z<p>Plussai: /* 12 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
[[Image:brep.jpg]] <br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,algorithm has the steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
<br />
d)come to (a) until there only exists three points in the linked list<br />
<br />
=== 12 July 2012 ===<br />
*Update my patches.<br />
<br />
==''Week 10''==<br />
<br />
=== 1 Augest 2012 ===<br />
*because of pressure of my paper schedule, I need to leave for a long time.I must<br />
say sorry that I will not complete the final-evaluation for gsoc.</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4170User:Plussai/GSoC 2012 log2012-07-14T22:57:10Z<p>Plussai: /* 10 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
[[Image:brep.jpg]] <br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,algorithm has the steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
<br />
d)come to (a) until there only exists three points in the linked list<br />
<br />
=== 12 July 2012 ===<br />
*Update my patches.</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4149User:Plussai/GSoC 2012 log2012-07-10T19:00:54Z<p>Plussai: /* 8 May 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
[[Image:brep.jpg]] <br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,algorithm has the steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
<br />
d)come to (a) until there only exists three points in the linked list</div>Plussaihttps://brlcad.org/w/index.php?title=File:Brep.jpg&diff=4148File:Brep.jpg2012-07-10T18:59:44Z<p>Plussai: uploaded a new version of "Image:Brep.jpg"</p>
<hr />
<div>brep structure</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4147User:Plussai/GSoC 2012 log2012-07-10T18:58:53Z<p>Plussai: /* 8 May 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
[[Image:brep.png]] <br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,algorithm has the steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
<br />
d)come to (a) until there only exists three points in the linked list</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4146User:Plussai/GSoC 2012 log2012-07-10T18:58:23Z<p>Plussai: /* 8 May 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
<br />
[[Image:rhino1.png]] <br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,algorithm has the steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
<br />
d)come to (a) until there only exists three points in the linked list</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4145User:Plussai/GSoC 2012 log2012-07-10T18:51:16Z<p>Plussai: /* 10 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,algorithm has the steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
<br />
d)come to (a) until there only exists three points in the linked list</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4144User:Plussai/GSoC 2012 log2012-07-10T18:50:50Z<p>Plussai: /* 10 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,algorithm has the steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
d)come to (a) until there only exists three points in the linked list</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4143User:Plussai/GSoC 2012 log2012-07-10T17:37:29Z<p>Plussai: /* 10 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,it has some steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
d)come to (a) until there only exists three points in the linked list</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4142User:Plussai/GSoC 2012 log2012-07-10T17:36:56Z<p>Plussai: /* 8 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]<br />
<br />
=== 10 July 2012 ===<br />
*find a algorithm for 'TrimLoop' triangulation,it has some steps below:<br />
a) make the node in 'TrimLoop' to form a linked list.<br />
b)for each triangle form by p0,p1,p2 successive in linked list,calculate the minimum inside angle.<br />
c)find the triangle which has the max minimum inside angle, then record the triangle and remove the point p1 in the triangle<br />
d)come to (a) until there only exists three points in the linked list</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4141User:Plussai/GSoC 2012 log2012-07-10T17:14:27Z<p>Plussai: /* 8 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that some trim leafs' bboxings overlap and it is difficult to find the nearest trim leaf above a surface leaf's bboxing in uv. Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.So, need a more accuracy method to check it.<br />
*image: some BBoxing in uv which should be trimmed are still remain(right bottom conner).<br />
[[Image:rhino.png]] [[Image:rhino1.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=File:Rhino1.png&diff=4140File:Rhino1.png2012-07-10T17:05:08Z<p>Plussai: </p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=File:Rhino.png&diff=4139File:Rhino.png2012-07-10T17:04:36Z<p>Plussai: </p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4138User:Plussai/GSoC 2012 log2012-07-10T17:04:13Z<p>Plussai: /* 8 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that a trimcurve leaf's bboxing is the nearest bboxing above a surface leaf's bboxing in uv,but the trimcurve is not the nearest trimcurve leaf above the surface leaf's bboxing in uv.Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.<br />
*some BBoxing in uv which should be trimmed are still remain.<br />
[[Image:rhino.png]] [[Image:rhino1.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4137User:Plussai/GSoC 2012 log2012-07-10T16:29:20Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]<br />
<br />
=== 8 July 2012 ===<br />
*continue to debug 'doTrimming'.There exists a situation that a trimcurve leaf's bboxing is the nearest bboxing above a surface leaf's bboxing in uv,but the trimcurve is not the nearest trimcurve leaf above the surface leaf's bboxing in uv.Function 'prepTrim' mark the surface leaf in such situation as 'm_checkTrim = true'.But in some cases, the surface leaf is trimmed out.I changed the subdivision depth to 10 manually and tested the rhino0.s in mged.Some surface leaves which should be trimmed out are still remain.</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai&diff=4135User:Plussai2012-07-10T08:24:36Z<p>Plussai: /* Link to progress log */</p>
<hr />
<div>==About Myself==<br />
*'''Name:''' Laijiren<br />
*'''Mail list ID:''' 55549227@qq.com(plussai) <br />
*'''IRC ID:''' plussai<br />
<br />
== Experience ==<br />
I'm a graduate student of CAD/CD lib in ZheJiang University.I'm good at C++/STL. I'm interested in data structures and algorithms and I'v participated in ACM/ICPC several years ago.I'v taken some course about CG and GM. So I'm familiar with NURBS and know well that NURBS is so important for a cad system<br />
<br />
== My proposal ==<br />
[http://www.google-melange.com/gsoc/proposal/review/google/gsoc2012/plussai/1 Trimmed NURBS Tessellation]<br />
<br />
== Link to progress log ==<br />
[http://brlcad.org/wiki/User:Plussai/GSoC_2012_log my progress log]<br />
<br />
== Some matericals ==</div>Plussaihttps://brlcad.org/w/index.php?title=File:HYP4.png&diff=4109File:HYP4.png2012-07-07T04:52:14Z<p>Plussai: </p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=File:HYP3.png&diff=4108File:HYP3.png2012-07-07T04:49:26Z<p>Plussai: </p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4107User:Plussai/GSoC 2012 log2012-07-07T04:49:09Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]<br />
[[Image:HYP3.png]] [[Image:HYP4.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=File:HYP2.png&diff=4106File:HYP2.png2012-07-07T04:48:19Z<p>Plussai: </p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=File:HYP1.png&diff=4105File:HYP1.png2012-07-07T04:47:46Z<p>Plussai: uploaded a new version of "Image:HYP1.png"</p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=File:HYP1.png&diff=4104File:HYP1.png2012-07-07T04:45:02Z<p>Plussai: uploaded a new version of "Image:HYP1.png"</p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=File:HYP1.png&diff=4103File:HYP1.png2012-07-07T04:41:28Z<p>Plussai: uploaded a new version of "Image:HYP1.png"</p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=File:HYP1.png&diff=4102File:HYP1.png2012-07-07T04:04:03Z<p>Plussai: </p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4101User:Plussai/GSoC 2012 log2012-07-07T04:03:26Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*ell:left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*ell:left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]<br />
<br />
*hyp:<br />
[[Image:HYP1.png]] [[Image:HYP2.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4100User:Plussai/GSoC 2012 log2012-07-07T04:02:21Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*left:top view,right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*left:local view,right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4099User:Plussai/GSoC 2012 log2012-07-07T04:01:52Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*left:top view right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*left:local view right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4098User:Plussai/GSoC 2012 log2012-07-07T04:01:10Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*left:top view *right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*left:local view *right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4097User:Plussai/GSoC 2012 log2012-07-07T04:00:48Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*left:top view right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*left:local view right:uv region<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=File:Ell4.png&diff=4096File:Ell4.png2012-07-07T03:59:34Z<p>Plussai: </p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4095User:Plussai/GSoC 2012 log2012-07-07T03:58:36Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test trimming<br />
*left:top view right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*left:local view<br />
[[Image:Ell3.png]] [[Image:Ell4.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4094User:Plussai/GSoC 2012 log2012-07-07T03:57:40Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
*left:top view right:left view<br />
[[Image:Ell3.png]]<br />
*left:local view</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4093User:Plussai/GSoC 2012 log2012-07-07T03:56:51Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
left:top view right:left view<br />
[[Image:Ell3.png]]<br />
left:local view</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4092User:Plussai/GSoC 2012 log2012-07-07T03:56:04Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test<br />
left:top view right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
left:local view<br />
[[Image:Ell3.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4091User:Plussai/GSoC 2012 log2012-07-07T03:55:40Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test<br />
left:top view right:left view<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
left:local view<br />
[[Image:Ell3.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=File:Ell3.png&diff=4090File:Ell3.png2012-07-07T03:54:02Z<p>Plussai: uploaded a new version of "Image:Ell3.png"</p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=File:Ell3.png&diff=4089File:Ell3.png2012-07-07T03:50:16Z<p>Plussai: uploaded a new version of "Image:Ell3.png"</p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=File:Ell2.png&diff=4088File:Ell2.png2012-07-07T03:46:36Z<p>Plussai: uploaded a new version of "Image:Ell2.png"</p>
<hr />
<div></div>Plussaihttps://brlcad.org/w/index.php?title=User:Plussai/GSoC_2012_log&diff=4087User:Plussai/GSoC 2012 log2012-07-07T03:45:06Z<p>Plussai: /* 6 July 2012 */</p>
<hr />
<div>=Community bonding period=<br />
<br />
== 7 May 2012==<br />
*build the brl-cad svn on VM successfully.<br />
*build the brlcad-7.18.4 on windows(vs2005),but some link error occured from libtclcad.lib(solved go_init(..)undefined)<br />
<br />
== 8 May 2012 ==<br />
*get familiar with the Brep structure.<br />
ON_CurveArray m_C2;//Pointers to parameter space trimming curves (used by trims)<br />
ON_CurveArray m_C3;//Pointers to 3d curves (used by edges)<br />
ON_BrepEdgeArray m_E;//edges<br />
ON_BrepFaceArray m_F;//faces<br />
ON_BrepLoopArray m_L;//loops<br />
ON_SurfaceArray m_S;//Pointers to parametric surfaces (used by faces)<br />
ON_BrepTrimArray m_T;//trims<br />
ON_BrepVertexArray m_V;//vertexs<br />
figure:[http://brlcad.org/w/images/5/5e/Brep.jpg]<br />
<br />
== 9 May 2012 ==<br />
*solve the link problem when build brlcad_18.4 in vs2005.(function go_init(..) undefinded)<br />
*understand some important point about NURBS. 3D NURBS is not tensor product surface,but it can be represented into tensor product surface by mapping 3D NURBS into 4D using homogeneous coordinate.(The NURBS BOOK page 30)<br />
*circle Arc can be represented by vector{(1,1,0,1),(1,1,1,1),(2,0,2,2)}in yz plane<br />
<br />
== 10 May 2012 ==<br />
*build brlcad-SVN successfully on my ubantu.(PS:/sh/make_deb.sh is a good tool)<br />
*study some about Nonuniform Scaling of Surfaces.<br />
<br />
== 12 May 2012 ==<br />
*find that the ehy.brep is lack of face and loop in brep structure.add them to make a correct brep. <br />
int surfindex = (*b)->m_S.Count();<br />
(*b)->NewFace(surfindex - 1);<br />
int faceindex = (*b)->m_F.Count();<br />
(*b)->NewOuterLoop(faceindex-1);<br />
<br />
== 13 May 2012 ==<br />
*find that computing the longest edge size is in the bspile/nurb_tess.c and the nurbs is represented by the form of struct face_g_snurb that is different from the ON_BrepSurface.It needs to implement a new interface for the longest edge size.<br />
<br />
== 15 May 2012 ==<br />
*configure some plug-in unit for my vim (e.g ctags,cscope,winmanger)<br />
<br />
== 19 May 2012 ==<br />
*submit a patch of brep_debug.cpp.check if the index is in the range and string of letter.<br />
<br />
=Coding period=<br />
==''Week 1''==<br />
<br />
=== 21 May 2012 ===<br />
*read the code of brep_debug.cpp which has many functions to debug the geometry in struct of Brep in mged.<br />
<br />
=== 23 May 2012 ===<br />
*update the patch of brep_debug.cpp.add the sub command 'info T','info E' for display the information of trims and edges in brep.Also, make the 'info' dispaly the information in a range of indexed elements for keeping sync with the 'plot'.<br />
<br />
=== 25 May 2012 ===<br />
*add a subcommand 'plot SCV' to display nurbs control point net <br />
<br />
=== 27 May 2012 ===<br />
*waste a lot of time to test the opennurbs' API of: <br />
int CreateMesh(const ON_MeshParameters& mp, ON_SimpleArray<ON_Mesh*>& mesh_list) const; <br />
* but,it seems difficult to make a good ON_MeshParameters to create mesh successfully.read the sources of opennurbs_mesh.cpp<br />
ON_Mesh* ON_BrepFace::CreateMesh( <br />
const ON_MeshParameters& mp,<br />
ON_Mesh* mesh<br />
) const<br />
{<br />
return 0;<br />
}<br />
<br />
==''Week 2''==<br />
<br />
=== 29 May 2012 ===<br />
*do some works on converting nurbs curve and surface to bezier<br />
<br />
=== 31 May 2012 ===<br />
*do some works on comput the intersection between a line and a bezier curve/surface<br />
*some materials: the nurbs book and Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide.<br />
<br />
=== 1 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-plot.c but it seems that dm-plot.c has nothing relation with the brep_debug.cpp<br />
<br />
=== 2 June 2012 ===<br />
*implement RT_ADD_VLIST(vhead, pt1, BN_VLIST_POINT_DRAW) in src/libdm/dm-ogl.c and upload the patch.<br />
*make progress for subcommand 'plot SCV' in mged.The patch can display not only the control net,but the control point.<br />
<br />
==''Week 3''==<br />
<br />
=== 4 June 2012 ===<br />
*one step that make 2d trimming curve into 3d can be skip because the BREP struct has the edge in 3d corresponding to the 3d trimming curve.<br />
*study the qd tree and kd tree for subdivision of nurbs surface in paper and the approximation error for the subdivision.<br />
<br />
=== 6 June 2012 ===<br />
*figure out the coving triangles to avoid cracks when making boundary curve tessellation.<br />
*figure out the trimming curve tracing when splitting the trimming curve into bezier patch.(the active edge,active leaftree)<br />
<br />
=== 8 June 2012 ===<br />
*read the opennurbs API and find the ON_NurbsCurve::MakePiecewiseBezier() can clamps ends and adds knots so the NURBS curve has bezier spans (all distinct knots have multiplitity = degree) ,the ON_NurbsSurface also has the same member method.It is a better way to convert trimming curve and surface into bezier<br />
*read the opennurbs API and find the ON_NurbsCurve::InsertKnot() can make the conversion between Nurbs and Bezier if setting the parameter multiplicity equal to degree.,the ON_NurbsSurface also has the same member method.<br />
<br />
=== 10 June 2012 ===<br />
*add 'info TB' 'SB' to display information piecewise bezier of trimcurve and surface.patch has been upload <br />
*add 'plot TESS index plotres' to draw the trimesh of a nurbs surface. the tess has not taken apporimmation into consideration and just simply subdivide u,v into plotres steps;<br />
<br />
==''Week 4''==<br />
<br />
=== 12 June 2012 ===<br />
*upload the patch to implement the adaptive bezier subdivision and triangle mesh display which includes the function bezierApporixmation(...),bezierSubdivision_kdtree..<br />
*read opennurbs_ext.cpp,especially figuring out the function of <br />
BBNode* SurfaceTree::surfaceBBox(...)<br />
BBNode* initialBBox(...)<br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
*SurfaceTree::subdivideSurfaceByKnots and BBNode* SurfaceTree::subdivideSurface can help me to create the kd/qdtree as a represent of bezier subdivision.But the recursion termination condition is different.<br />
<br />
=== 14 June 2012 ===<br />
*In function of SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531:<br />
const ON_Surface* surf = m_face->SurfaceOf();<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() - vq, frames[5]);<br />
localsurf->FrameAt(u.Mid() - uq, v.Mid() + vq, frames[6]); <br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() - vq, frames[7]);<br />
localsurf->FrameAt(u.Mid() + uq, v.Mid() + vq, frames[8]);<br />
Interval u,v is in gloable area, So I think the four lines above need to be modified.<br />
*Read the BBNode structure in opennurbs_exp.cpp, BBNode will be used to represent the node in qd/kd tree and handling the trimcurve.<br />
<br />
=== 16 June 2012 ===<br />
*upload a patch in opennurbs_ext.cpp<br />
*add three functions below to subdivide bezier,in opennurbs_ext.cpp<br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
double getBezierApporixmation(...)<br />
*add two functions below to create BezierTree root as the struct of BBNode <br />
bool setFace(ON_BrepFace* face, bool removeTrimmed);<br />
BBNode* createBezierTreeNode();<br />
<br />
==''Week 5''==<br />
<br />
=== 18 June 2014 ===<br />
*compare surface split between <br />
BBNode* subdivideSurfaceToBezier(...)<br />
BBNode* subdivideBezier(...)<br />
and <br />
BBNode*SurfaceTree::subdivideSurfaceByKnots(...)<br />
BBNode* SurfaceTree::subdivideSurface(...)<br />
the original method seem to be unsymmetric when split ell.brep sphere.brep. But the new method has not taken the edge length into consideration,so the ratio of lengths in u,v direction may be too long or too small.<br />
*understand SurfaceTree::subdivideSurface() at src/opennurbs_exp.cpp,line 1528 to 1531, it comes to the same result when replacing localsurf into surf because the localsurf's domain is change along with the split.<br />
<br />
=== 20 June 2012 ===<br />
*figure out the functions below in brep_debug.cpp which is used to draw trimmed BBNode of surface.But these functions seem not be able to remark the intersections of BRNode and trimcurve<br />
void drawBBNode(....)<br />
void drawisoU(....)<br />
void drawisoV(....)<br />
void drawisoUCheckForTrim(.....)<br />
void drawisoVCheckForTrim(.....)<br />
*figure out the trimflag of BBNode: m_trimmed,m_checkTrim and the function of preptrim() in opennurbs_ext.pp.<br />
when a BBNode is remark as m_trimmed is true, the BBNode has been remove out from the surface.<br />
When a BBNode is remark as m_trimmed is true, the BBNode in uv region has intersections with the BRNode of trimcurve,so <br />
it need to be check again and compute the interections if needed.<br />
<br />
=== 22 June 2012 ===<br />
*figure out the functions below in opennurbs_ext.h which can help me to comput the intersection between BBNode and trimcurve. <br />
fastf_t BANode<BA>::getCurveEstimateOfU(fastf_t v, fastf_t tol) const<br />
fastf_t BANode<BA>::getCurveEstimateOfV(fastf_t v, fastf_t tol) const<br />
*add a function below to return the parameter t of the intersection based on the two functions above <br />
template<class BA><br />
fastf_t BANode<BA>::getCurveEstimateOfT(fastf_t value, bool direction, fastf_t& t, fastf_t tol) const<br />
*add a function to sort the BRNode in CurveTree by the t in parameter region.<br />
sortT(BRNode* first, BRNode* second);<br />
<br />
=== 24 June 2012 ===<br />
*implement TrimNode and TrimLoop to represent the struct of untrimmed regions in parameter area.some functions included below:<br />
TrimLoop(ON_Interval m_u,ON_Interval m_v):tol(0.000001);//construct<br />
TrimNode* findPos(TrimNode* n);//find the position to insert for a new trimnode<br />
TrimNode* findSamePoint(const ON_2dPoint& pt);//find the node whose point in parameter is equal to pt<br />
bool linkOnTrimNode(TrimNode* pre,TrimNode* next);//link two trimnode which both within the bboxing<br />
bool insertInEdge(TrimNode* pos, TrimNode* n);//insert a new node<br />
TrimNode* travelLoop(TrimNode* n,int step);//travel from a trimnode to form a close loop<br />
<br />
==''Week 6''==<br />
<br />
=== 26 June 2012 ===<br />
*start to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*implement getLeavesIntersection(....) to find the bboxings of curveleaves which have intersections with the BBNode in UV region<br />
*calculate the intersection between edge of bboxing and trimcurve's leaves(bottom,top,left,right)<br />
*solve some special sitiuations: intersection on the conner of bboxing.<br />
<br />
=== 28 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: trim curve is collinear with the bboxing's edge. if the start or end point of trim curve is within bboxing's edge, it is regarded as the intersection between edge and trimcurve.<br />
*in function of BANode<BA>::isTrimmed(const ON_2dPoint& uv, fastf_t &trimdist) const , ' <= ' is used to compare float number. It may cause error because float's precision error,So I make some improve for it. This function will be useful in doTrimming.<br />
*link the innerNode in BANode's BBoxing of uv by call the function inline bool TrimLoop::linkOnTrimNode(TrimNode* pre,TrimNode* next)<br />
<br />
=== 30 June 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: the BVNode covers some trimcurve's bboxing which is remarked as m_checkTrim, however, the BVNode has no intersections with any trimcurve. the method which I use may is not precise enough,So I'll try to make a better one.<br />
*add two functions for BANode for judging if a point is contained in a BANode<br />
bool containsUV(const ON_2dPoint& uv);<br />
bool containsUVClose(const ON_2dPoint& uv);<br />
*debug for doTrimming() by subdivide plane surface manually in BBNode* SurfaceTree::subdivideSurface()<br />
<br />
==''Week 7''==<br />
<br />
=== 2 July 2012 ===<br />
*continue to implement BVNode<BV>::doTrimming function in opennurbs_ext.cpp.<br />
*deal with a special situation: if a trimcurve is collinear with a edge of BBNode's uv region and a endpoint of the trimcurve is just on the uv region's conner, the conner point will not to be the intersection.<br />
*add a flag 'unTrimmed ' in 'TrimLoop' to mark if a BBNode's uv region has been trimmed, situation of trimcurve lies on edge, endpoint just on edge are included;<br />
<br />
=== 4 July 2012 ===<br />
*insert adjacent subdivide hit into every BBNode's uv region.<br />
*add member var into class BVNode<BV> and assign these member when subdividing surface <br />
BVNode<BV>* north;<br />
BVNode<BV>* south;<br />
BVNode<BV>* west;<br />
BVNode<BV>* east; <br />
BVNode<BV>* parent;<br />
*add member function into class BVNode<BV> to get adjacent node<br />
BVNode<BV>* getAdjacentNorth();<br />
BVNode<BV>* getAdjacentSouth();<br />
BVNode<BV>* getAdjacentWest();<br />
BVNode<BV>* getAdjacentEast();<br />
*add member function into class BVNode<BV> to insert adjacent subdivide hit <br />
void insertAdjacentHit();<br />
<br />
=== 6 July 2012 ===<br />
*add a trimcurve for ell.brep and hyp.brep manually to test<br />
[[Image:Ell1.png]] [[Image:Ell2.png]]<br />
[[Image:Ell3.png]]</div>Plussaihttps://brlcad.org/w/index.php?title=File:Ell1.png&diff=4086File:Ell1.png2012-07-07T03:44:22Z<p>Plussai: uploaded a new version of "Image:Ell1.png"</p>
<hr />
<div></div>Plussai