Can somebody create small script, which generates perpendicular lines 5mm long (or 10mm long in case of midpoint line) in exact defined points with direction inwards the closed curve.
Basically it is one simple closed curve with 15 - 40 points on it. Till now I generated these lines manually. So I’ve got idea if this operation can be scripted.
Small explanation: The curve represents flattened shape of automotive (car) glass, the generated lines are engraved and all this is 2D checking fixture (gauge) for production lines.
Because I have always believed that is good first to try by yourself I will explain you my logic to solve this. Give it a try in GH.
Take your points and calculate the closest point to the curve from those points (we are looking for the parameter at the curve here).
Evaluate the curve at the obtained parameters.
Try to think about a vector operation that with a constant vector (this only work “well” if the curve is flat) and the tangent vectors obtained evaluating the curve is going to give you your inward vector. TIP: the operation name starts with “Cross”.
Use SDL component in GH to create your curves using the vectors obtained in step 3.
Step 3 could be done in other different ways but I like this general way to control the direction of your resultant vectors.
Thank you Dale.
Here is the file, on the left is “before” and on the right is “after”. Although this “glass” is 10 years old I removed all sensitive informations due to restrictive condition in automotive industry. test_file.igs (121.9 KB)