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.

New Curved Text FeatureScript

dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
I've spent some time making a FeatureScript that makes it a one-step operation to add curved text to an object:






Features:
  • Automatically fits text to the selected baseline length
  • Follow a baseline of any shape: linear, arc, or spline
  • Select text depth
  • Embossed or Raised Text
  • Center, Right, Left, or Justified text
  • Override character spacing and height as desired.
  • Choose any Onshape supported font

You can read more here:


or simply load up the document directly, here:

«1

Comments

  • brucebartlettbrucebartlett Member, OS Professional, Mentor, User Group Leader Posts: 2,141 PRO
    Awesome Feature, this will come in very handy, heres a video of my first use. Hopefully it will help you to improve it more.

    https://goo.gl/ITo0p6

    2 thing that come to mind is a "through all remove" for laser cut plates and "draft feature" for moulding

    Bruce
    Engineer ı Product Designer ı Onshape Consulting Partner
    Twitter: @onshapetricks  & @babart1977   
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    @brucebartlett

    Thanks so much for this video! I have not seen someone record themselves trying to use something for the first time. Its really, really insightful.

    I can see a few things that would have helped:

    (1) maybe some default text would have helped so you saw something right away.

    (2) do you think that the behavior that fits text to the length of the baseline wasn't a good starting point? It took a while for you to figure out that the alignment was fitting to the baseline

    Basically, when you are in 'fit' mode, the height and the spacing will be re-computed so that the text takes up the entire baseline length.  Alignment of Left, Center, and Right might be more obvious for first time users. But i was worried that then people wouldnt figure out that they dont have to fiddle with the spacing and height to get the text to fit nicely.

    Thoughts?
  • chris_wentworthchris_wentworth Member Posts: 3 EDU
    TO THOSE OF US WHO ARE NOT PROGRAMERS HOW DO WE USE THIS?  IS IT BUILT INTO ONSHAPE?  IS IT AND ADD ON?  HOW DO YOU RUN A SCRIPT?
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    @dave_cowden

    Hi Dave.  Just tried this properly for the first time.  Great tool, really wished I'd started earlier. :) Way easier to use than the current inbuilt option.

    Only minor niggle I found was that with a "add" operation the colour of the body I added text too changed colour each time a feature was added.  Easy to change back but worth mentioning.

    Cheers, Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Oh, also noticed it kills the name of a part.  I wonder if both issues are down to the order in which things are joined by a boolean operation?  So the new part takes the colour and name of the next available default rather than the parent part?

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,215
    That sounds likely -- when doing an opBoolean, the "identity" (including color and name) of the first input part is preserved.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    Thanks @owen_sparks for trying out this feature! glad it worked for you.

    I'm not sure i can fix the color-- i'll have a look at the code and see if it is possible to change the order of operations.

    @chris_wentworth  Here's roughly the steps you do:

    (1) add this featurescript to your toolbar. To do that, click the 'plus' in your menu bar, and find PP_CurvedText, and it will add a button on your toolbar. Then, you click that button, and it will launch a dialog you can use.  You can find more detailed steps and a video on how to do this here ( about 1/2-way down the section titled "Start Using Custom Features"

    (2) choose a face and a text baseline, and type your text. You should see text generate. By default, the text will be fit to include the baseline

    Give me a shout here if you need help! The curved text tool has a lot of options-- you can fit text to the baseline, left/right justify it, bottom-top-middle align, etc.  Its a bit overwhelming if you are first using it, so i'm here to answer questions!

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,215
    edited September 2016
    @dave_cowden
    I can't see your code, but it should really be possible to fix the name/color issue.  It's usually something like passing
    qUnion([selectedBody, newTextBody])<br>
    as the opBoolean tools instead of
    qUnion([newTextBody, selectedBody])<br>

    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    @ilya_baran , thanks-- yep i'll make that change if i can.  Though i don't know, @owen_sparks  are you sure you dont actually like the random color change? Maybe i'll add a boolean input like 'rainbow mode'  and if true i'll retain current behavior....
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,215
    While I am all in favor of random color changes, the bug is actually worse than that -- if the boolean is done in the wrong order, downstream features (like transforms, part patterns, etc) referencing the part will break if curved text is inserted before them.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    @ilya_baran  sheesh, always strong with you is the _logic_ ! :)  
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Hi Guys.

    @ilya_baran @dave_cowden

    I have a problem.  It's my first day as a pro user and I have to tell my manager i can't access my work...

    If I try to open this file:-
    https://cad.onshape.com/documents/2c840cb28e5207c4781d3f80/w/4719e272c552a0e241b3c6e6/e/5f29bb6ae63c4d335385778d

    I receive this error message:-
    Universal Tester back Panel

    Error imported from "57ca74a10cd7bd10b8251ac2/d15880e0a6fb6e40a61d1618/cfa6def46a8be813631b4326": Module not found for import: (path : "d9e449e07522374d3a449ca1/bc96808e78d94bbe91afe996/0dc001b527bdec2e78360668", version : "6adfa23a625960df45896454")


       
    Universal Tester back Panel

    31:1   
    PP-CurvedText-Beta - Copy / Start / text.fs

    This is a work project that was fine when I left work last night but that will now no-longer regenerate.

    Any help gratefully appreciated.

    Owen S.


    Business Systems and Configuration Controller
    HWM-Water Ltd
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,215
    @owen_sparks
    The link you posted opens and regenerates fine right now for me, but what you're reporting looks very likely to be a bug.

    The best way to report bugs is not the forum, but the feedback button (and sharing with support) -- that lets us examine your data in more detail and track your request for help properly.  Please do this and we'll do our best to resolve this issue.

    Apologies for the inconvenience.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    @ilya_baran

    Thanks, I've tried it a couple of times with the same error, but as you say it opens fine now.

    I'll use feed back in future, I posted here this time as it was throwing an error on the FS so wanted Dave to be able to see / comment.

    Thanks for your help, Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    @ilya_baranDo you suspect a bug in the feature code or elsewhere? If it seems like a bug in FS, then @owen_sparks please share the document with me so i can diagnose. I dont know why a module would not be able to be found--i have not changed this feature or its associated libraries in the last two months.
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Hi @dave_cowden, sorry I've been nattering to Ilya and he believes the issue is on their end.  Sorry to besmirch your good name.  I've raised a support ticket so I think you're off the hook :)

    Owen S
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    @owen_sparks  ok thanks.  I've written code for a lot of years-- one thing I've learned over that time is that i'm not capable of writing no bugs.  I try, but I always fail.  I do hope I can convince people that I am proactive and helpful when they arise-- if I achieve that, it will be ok!

    Just shout out if you need help-- i'll support.  This weekend i hope to review changing the boolean order, so if i need to fix/change something i can do it then.
  • Will_SchleterWill_Schleter Member Posts: 9 EDU
    First off - thanks for the great feature. I know how hard it is to do something like this.

    I've run across a couple of issues illustrated in this file

    https://cad.onshape.com/documents/0bf8664cd9e80e9ee655ea90/w/90bdb57f6cc81221f44fac03/e/20c18a0fdcb8a26ed2acfcd9

    The first is text on the side of a simple curved surface doesn't always work. Seems most (but not all) of the letters with curves don't work. I've tried different fonts, different surfaces, but no luck.

    The second is the text on the top always shows up as a separate part for each letter. This means I can't emboss (remove). If the base surfaces a solid cylinder it works OK, it is just an issue with the donut shaped planar surface.
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    Hi @Will_Schleter

    Thanks for trying out the feature!

    Regarding your first issue,  you have chosen to align your text along the very bottom of the part, which means your text baseline is actually the bottom of the face.  The issue is that many letters extend below the baseline.  So, the letters that do not work are those which extend below the baseline ( for example lower case j ). The letters that are now shown are 'falling off' of the face.  Making a baseline that is slightly above the bottom will solve this issue. It is worth noting that there are MANY ways that you can have your text fall off the face, and the feature will always behave this way.  I've discussed with others the idea of extending the face to make it work, but everyone has said that it would be unexpected and bad behavior to modify the base part.

    You can read more about that discussion here: https://forum.onshape.com/discussion/comment/23965#Comment_23965

    Regarding your second question, for the last option choose 'Raised Add' instead of 'Add New', and the letters will be added to the existing part.

    No matter what options you choose, the text is always generated as a separate set of letters. This is necessary to make it possible to follow curves, because Onshape text does not support this natively.

    Hope that helps!
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    @Will_Schleter  @owen_sparks @brucebartlett

    I've [finally] released a new version of Surface Text. The new version is much more robust. Text can now be adjusted either to the baseline ( which is above the bottom of 'j' and 'g', or to the absolute bottom extent of the text. This allows using the edge of a surface as the base curve.

    In addition, I've made text generation much more robust. If the text runs 'off' of the base surface, it will be truncated rather than throwing a regen Error.

    https://cad.onshape.com/documents/cad175bd2990f3c9314a1c10/w/05ec37b276b1dd333f6afc16/e/08c7b53ee50a34dc6966a026
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    @here I've also updated the existing document. If you have this feature in your toolbar, you can just upgrade it to the latest version
  • chris_8chris_8 OS Professional Posts: 102 PRO
    edited May 2017
    @Will_Schleter  @owen_sparks @brucebartlett

    I've [finally] released a new version of Surface Text. The new version is much more robust. Text can now be adjusted either to the baseline ( which is above the bottom of 'j' and 'g', or to the absolute bottom extent of the text. This allows using the edge of a surface as the base curve.

    In addition, I've made text generation much more robust. If the text runs 'off' of the base surface, it will be truncated rather than throwing a regen Error.

    https://cad.onshape.com/documents/cad175bd2990f3c9314a1c10/w/05ec37b276b1dd333f6afc16/e/08c7b53ee50a34dc6966a026
    Thank you for this updated great FS!  

    I do have a question about which way is front.  How do I tell SurfaceText which way I want the text to be extruded?  Maybe the option is intended to be there with a reversible arrow now, but currently I get the same result from both reversible arrows.  The arrow next to "Text" and the arrow next to "Text Depth" both cause inverting the text outlines, but neither of them will allow me to flip the extrude direction.  Also if I mouse hover over either arrow, I see the same pop-up description: "Text Direction"

    ETA:  Now I see the results are not the same:  The arrow next to "Text" rotates the outlines 180 degrees.  The arrow next to "Text Depth" inverts the text vertically.  

    Solution found:  I needed to thicken the surface and that made the text extrude in the desired direction.  

    Great FS!
  • dave_cowdendave_cowden Member, Developers Posts: 475 ✭✭✭
    @chris_8 glad it worked for you. In testing, I did see a scenario like you reported occur.

     the FS does a good job of figuring out which way to extrude text when the surface selected is a solid. When it is a surface, there is really no 'right' way, so it guesses.

    Embossed (cut out) text doesn't make sense on a surface, so I didn't add the complexity of a selectable extrusion direction to the feature.

    If it becomes an issue, I will add it, but I'd like to keep the Featurescript simple to use if possible 
  • GIZMOGIZMO Member Posts: 11
    Embossed text on curved solids (including a sphere) has MANY applications; would like to see selectable extrusion direction option. Having a lot of problems with your feature script, but don't know if due to bugs or my inexperience with your feature. Trying to add degree numbers to degree marks to a sphere; finally got it close for a planer surface, but text only raises, will not emboss.
  • paul_leachmanpaul_leachman Member Posts: 1
    I was wondering if there is a way to change text size

  • mahirmahir Member, Developers Posts: 1,309 ✭✭✭✭✭
    edited August 2018
    I was wondering if there is a way to change text size

    A Text Height option appears once you selection anything other than "Fit" for Text Align.
  • patrick_anthonypatrick_anthony Member Posts: 13 ✭✭
    I found another awesome use of this feature ... Thank you Dave Cowden.   https://photos.app.goo.gl/L8Q5wUMNJe9yLV2A6 
  • pat_dunnpat_dunn Member Posts: 1 EDU
    https://cad.onshape.com/documents/cfec40e2b66bb4ddb2f3414b/w/24132f252a02825eb0606641/e/81168802b9c23649a5baa5bc
    This is the MOST RECENT VERSION of the FeatureScript document. Just so no one has to go down a rabbit hole looking for it.
  • kevin_o_toole_1kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565
    ^ And in general, for a curated list of awesome, tested, updated, public custom features, you can always refer to onshape.com/features/custom-features
  • rupert_harpurrupert_harpur Member Posts: 3
    hello. I know I'm a few years late to this however I've been using your FS recently without issue aside from being unable to change which way the text is meant to be viewed from. (when using surface text on two curved faces next to each other, one appears upside-down  compared to the other. after playing around with which baselines and base surfaces I select I have been unable to change the orientation of the text. Am I missing something or is this not available? 

    many thanks for a great FS and for any help given,

    RH
Sign In or Register to comment.