SkillAgentSearch skills...

RectifyingStripPatterns

This is an implementation of the paper "Rectifying Strip Patterns" (SIGGRAPH ASIA 2023). The code is to design rectifying strips with controllable inclinations on surfaces

Install / Use

/learn @wangbolun300/RectifyingStripPatterns
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

Rectifying Strip Patterns

<img src="./data/fig/code_teaser.png" /> This is an implementation of the paper "Rectifying Strip Patterns" (SIGGRAPH ASIA 2023). The code is implemented in C++, and tested on MSVC and GCC. This is a framework to design rectifying strips/structures, including a scalar field optimization framework, a quad mesh optimization framework, code for optimizing space curves into rectifying strips, etc.

Citation

If you use our code in your project, please consider citing the original paper:

@article{Wang:2023:Rectifying,
    author = {Wang, Bolun and Wang, Hui and Schling, Eike and Pottmann, Helmut},
title = {Rectifying Strip Patterns},
year = {2023},
issue_date = {December 2023},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
volume = {42},
number = {6},
issn = {0730-0301},
url = {https://doi.org/10.1145/3618378},
doi = {10.1145/3618378},
month = {dec},
articleno = {256},
numpages = {18},
keywords = {architectural geometry, computational design, computational fabrication, gridshell, pseudo-geodesic, shading system}
}

Compiling Instruction

To compile the code, first you need to install CMake (https://cmake.org/), To build the executable on Linux or macOS:

cd RectifyingStripPatterns/
mkdir build
cd build
cmake ../  -DCMAKE_BUILD_TYPE=Release
make

To build it on MSVC, you need to download openmesh into the "external" folder, unzip it into "external/openmesh/OpenMesh-9.1.0" and build it into "external/openmesh/OpenMesh-9.1.0/build".

Then double-click the executable lsc_devbin, you will see a pop-out window whose buttons link the functions that generate all the results in our paper.

<img src="./data/fig/mainpage.png" style="zoom:40%;" />

Usage

Some useful shortcuts:

  • i is to invert the normal directions of the viewer.
  • d is to enable double-sided rendering.
  • x is to delete the selected mesh in the Mesh Management list.

Some tips:

  • Please always check if there is any new mesh added into the Mesh Management list. Sometimes after pressing the buttons, there is no change in the main view window, but the new mesh is already added into the list. To see the renderings of the new results you need to make other meshes invisible by clicking the checker boxes on the left of the mesh files.
  • Please always check the information printed in the terminal, it will tell you the numerical errors, how to read/write files after pressing the corresponding buttons, if there are singularities, etc.
  • Every time you get a scalar field, don't forget to save it using Save levelset. If you have a scalar field and a model in the framework, close the exe and reopen it before loading another model or scalar field.
  • When it prints "flip u" in the terminal, it means the convergence is not stable. You should first use a small weight pseudo geodesic, run a few iterations until it turns stable, then gradually increase the weight.
  • When it prints "Singularity" in the terminal, it means there are singularities in the scalar field. Enhance the constraints on smoothness and strip width until the singularities disappear.

Interactive design of P-curves

  • Press the button UseUnitScaleMesh on the top left of the viewer to unit-scale the mesh.
  • Draw the guide curves: Press the key 3 on the keyboard, and draw a few curves on the surface using your mouth, then release the key 3. Make sure that there is no intersection. The strokes should be smooth, generally in the same direction, as shown below
<img src="./data/fig/strokes.png" style="zoom:40%;" />
  • If you are not satisfied with the strokes, you can clear the strokes by pressing Panel 1 -> InterActiveDesign -> ClearStrokes. A clean mesh will be added to the Mesh Management so that you can redraw curves on it.
  • Press the button Stroke2LS to confirm the drawing.
  • Press AutoRunSmooth to generate the smooth level sets that follow the strokes. The details for each iteration is printed in the terminal. The target P-curve angle $\theta$ is also printed out, e.g. "target_angle, 76.5434".
  • After obtaining the smooth level sets generally following the strokes, press AutoRunPG, wait for a few seconds, then the scalar function whose level curves are pseudo-geodesic curves of $\theta$ is generated. Press Save levelset to save the scalar field and the binormal vectors. In this step, the scalar field is automatically optimized using the default parameters.

Initialize the scalar field by tracing P-curves.

  • Open the exe by double-clicking it, there is a default mesh already loaded. If you want to use another mesh, load it by pressing Import Mesh, delete the default mesh, and now you have a clean workspace.
  • Trace guide curves using the buttons under the Tracing catalog. The start points of tracing curves are on the boundary of the mesh. There are two TracingType you can choose to quickly decide where the start points are. SegTrace chooses a segment that contains "nbr bnd edges" edges of the boundary starting from the "start bnd edge"th edge of the boundary loop. The distance between two neighboring start points is "every i segments". Another TracingType is OneEdgeTrace. If your mesh has corner points on the boundary, you can select the "Select 1 boundary"th segment of the boundary curve split by the corner points. corner angle helps to decide the corner points. The following figure shows the traced curves under OneEdgeTrace mode.
<img src="./data/fig/tracing.png" style="zoom:40%;" />
  • Now we trace curves. Set up the start angle and $\theta$ = target angle, press Trace Curves, and P-curves will be traced out and rendered in the viewer.
  • Or, you can also trace 1 curve each time by properly setting up the parameters under SegTrace mode, save and load them one by one. This gives you more precise control of the start directions and curve locations.
  • Make sure there is no intersection in the traced curves.
  • Now we turn to Energy Solving catalog. Tune weight boundary and weight laplacian and press LvSet Opt under the LS Processing catalog, you will see the generated level sets after running a certain number of iterations decided by Iteration.
  • Save the scalar field if you are satisfied with the quality. See figure: <img src="./data/fig/smooth.png" style="zoom:40%;" />

Optimize for P-curves with user-specific parameters

  • Press Import levelset to load a scalar field and Import Mesh.
  • Set up weight laplacian to control the smoothness, weight Strip width to control the gradient not far from 1, weight pseudo geodesic for the $E_{angle}$. Set the checker boxes Enable PG Energy and Enable Strip Width as TRUE, then run LvSet Opt to optimize for $\theta$ = target angle. The figure below shows P-curves of $\theta = 60^\circ$ and the optimization parameters.
<img src="./data/fig/carpet60.png" style="zoom:40%;" />
  • We recommend you start from large weight laplacian and weight Strip width, and small weight pseudo geodesic, then gradually change the parameters as what we showed in the figure above, to improve the stability of optimization.
  • Note that the errors printed in the terminal are the sqrt of the energy. the example above prints out "pg, 0.00318374" meaning that the error $E_{angle} = 0.00318374^2 =$ 1.01e-5.
  • To use $E_{geo}$ and $E_{asy}$ for geodesic and asymptotic instead of $E_{angle}$, you can set Enable Extreme Cases as TRUE. If target angle = 0,then $E_{asy}$ is enabled; Otherwise, $E_{geo}$ is enabled.

Optimize level sets for AAG.

After obtaining the scalar fields for the two families of asymptotic curves, load the two fields using Load First Level Set and Load Second Level Set, respectively. We call the 3 scalar fields F, H and G, where G is the 3rd scalar field. Now we optimize the 3 scalar fields simultaneously. You can input the parameters as before, and there are some new parameters:

  • weight_geodesic is a ratio of the parameters of G, which means the weights for G are $weight *$weight_geodesic, while for F and H are $weight$. It makes the optimization easier since we can start from a vanishing G and gradually add G back.

  • weight boundary now becomes the weight for the condition $F+H+G=0$.

  • Under the catalog Panel 1 -> TwoLvlStAngle there are buttons and parameters to set up the angles between the level sets of F and H. For AAG optimization we don't need them since the asymptotic directions are totally decided by the geometry, but for AGG, PPG, etc., the angle constraints can be useful to generate visual-pleasing meshes. Remember to set the WeightAngleOfLSs as small values since they can only be weak constraints.

  • Press AAG lvSet to run the optimizations. You can also press AGG LvSet to run AGG, or PPG LvSet to run PPG. Press Save AAG to save 3 scalar fields in a row (works for AAG, AGG and PPG). The pseudo-geodesic angles $\theta_F$ and $\theta_G$ for PPG are target angle and second angle, respectively.

Extracting quad mesh from scalar fields

  • Load the two scalar fields: Load First Level Set, Load Second Level Set.
  • For nets that only contain two families of curves, press Ortho Fields Quads, then you can save the generated quad mesh and some mesh structure info files. The number of parameter lines of each scalar field can be controlled by Nbr of U lines and Nbr of V lines.
  • For 3-webs like AAG, AGG and PPG, whose diagonals of the quads are also mesh edges, please use Extr Pace Quad. Nbr of U lines will control the density. It will sample both the u and v scalar functions with an even pace to make sure $F+H+G=0$. The 3-webs are also saved as quad meshes. The diagonal information is written into
View on GitHub
GitHub Stars11
CategoryDesign
Updated4mo ago
Forks3

Languages

C++

Security Score

92/100

Audited on Dec 5, 2025

No findings