Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Fill Pattern where the shape of the body to be patterned is different each direction

BStumpBStump Member Posts: 19 ✭✭
I am looking to see if there is a fill pattern in Featurescript that has the ability to control both direction dimensions independently.  I have a fill where the shape of the body to be patterned is different each direction, so to pattern it I need to control both directions.  Anyone done this or suggestions?
Tagged:

Comments

  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    I'd suggest copying the FeatureScript Fill Pattern, adding a parameter named definition.length2 and making the following changes:

    Change line 70 to
    var maximumIndex = round((norm(diagonal) - (definition.border * 2)) / min(definition.distance, definition.distance2));
    and change line 90 to
    var translation = (direction * i)  * definition.distance + (angled * j)) * definition.distance2;

    If you want the two directions to be perpendicular (rather than the current hex grid), you'll also want to change line 45 to use 90 degree angles.

    Cheers to @NeilCooke for writing clean code that's this easy to modify :D
    Let us know if you encounter any issues!
  • BStumpBStump Member Posts: 19 ✭✭
    Well that is a good start. In this case you need to consider the shapes I want to pattern to be something like dog bones (https://macrotrac.com/wp-content/uploads/2016/12/i-trac-pic.png ). I just need to be able to do a fill using the basic shape with appropriate offsets in each direction ( I don't need the surface details, the tabs, pins, locks, or tread). The shape nests, so a bounding box would show significant overlap. The angle is not 0, 45 , or 90, but about 29.56 degrees. I am seeing if I can find a way to simplify layouts using Onshape.
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,648
    @kevin_o_toole_1 as much as I'd like to take credit for it, the master code comes from the master coder himself @paul_chastell
    Senior Director, Technical Services, EMEAI
Sign In or Register to comment.