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.

Curved Text around revolved body

Hi
I used the future script from dawe _crowden (thanks for it) but it not working with some characters (example C and O).
Can somebody look on it?
This is the open version my try:
https://cad.onshape.com/documents/7fbaf46e160aab9001f736d8/w/d92e335872424bc5d61d2e94/e/7a5251c4970e44b8137bcc6d

Any help would be great also other solution is possible.

Thanks,

Attila

Answers

  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Is @dave_cowden still about, not seen him post in a while?

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    @owen_sparks  @attila_balogh
    Yep, still here!

    I've got this on my list to look at.  I had a look at the example document above, and yeah, its weird, that should work.  I need to make a copy of it and turn on debug to see what's going on.
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    @owen_sparks  @attila_balogh
    Yep, still here!
    Hurrah.  Glad to hear it Dave.

    (a) I took a copy and got the same results. 
    (b) I tried rebuilding it in the copy and it did other weird things such as completing without error thrown but not showing any letters at all.
    (c) Tried rebuilding it in a new document and couldn't get it to miss any letters at all.  The only issue was a couple of letters were created lower on the cylinder than others.

    Cheers,

    Owen S.


    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    @owen_sparks when you rebuilt it did you use a revolved surface as the start, rather than extruded? My hunch is that's the operative difference. 

    Underneath the hood, the curved text feature uses my other offset face feature to produce an offset surface. the offset algorithm is imperfect, due to limitations with onshape. ( which now that i think about it coudl have been remedied by now).  So sometimes that's the underlying problem. 

    @attila_balogh
     i'm going to have a look soon-- i'll get to the bottom of it.
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    edited December 2016
    @dave_cowden I used a simple extruded circle rather than a revolve in each case.

    I've used the feature on a flat surface of some 3d printed parts and it worked really well so thanks for the effort made to write it.  :)   It's also useful to note that the text can be easily changed with this feature, unlike a bunch of extruded sketch entities...

    Cheers,

    Owen S
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    @owen_sparks
     thanks for the kind words.  This is an area where Onshape is actually ahead of many of the other CAD packages i use ( for example, Fusion360  and older versions of solidworks).  Neither of these packages support text on a curved surface either, but writing a plugin is MUCH harder to write and install on those platforms.

    @attila_balogh  my gut feeling based on owen's experience is that the problem has to do with the fact that your starting surface was created using a revolve. I have absolutely no idea why that matters, but i'll figure it out and get it fixed.
  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    edited December 2016
    Hi, @owen_sparks, @attila_balogh

    Ok, I figured this out. In this case, the selected baseline was the very bottom of the cylinder.  The letters that were not working were failing an extrude because they happen to be the ones that extend below the baseline.  Since they extend below the baseline, my extrude between function fails because there is no from/to surface.

    In this corrected copy of the example document, the problem is fixed, because the letters fit on the surface:



    In fact, this issue will happen anytime that the letters would fall off/outside of the base surface. For example, in the above pictured case, you can cause all of the letters to fail by changing alignment to 'middle' or top, which causes all of the letters not to fit. 

    https://cad.onshape.com/documents/58455599c184841040115b86/w/36188db15320b65bf4a79aca/e/5fe9510abb239a6d09926634

    This is a vulnerability in my code, but unfortunately it is not really easy to fix.  The fix requires establishing bounding surfaces that extend far enough past the original surface.  Onshape really doesn't provide very good surface tools, and even with good tools it is not trivial to extrapolate a surface past its original boundaries.  

    For now, the work around is to make sure the letters actually fit onto the surface. In most cases, this is probably not the intent.

    @attila_balogh and @owen_sparks , do you think this use case needs to work, or should I just provide a better error message about why the characters are not generating?  I'll have to think and research a little to see if I can figure out how to 'extend' a surface.  I'm pretty sure it is not possible in the general case, but I think it is possible in the case of a conic or cylindrical surface ( as is the case here ).

    Thank you for reporting this @attila_balogh , this will let me make the feature better!
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    @dave_cowden

    Hi Dave. Great news.

    (1) A more informative error message would do just fine in my opinion, especially for a free feature.

    (2) I may be being thick but I don't understand the initial failure mode.  If all the letters are capitals (which they were) why would any portion of any letter be below the bottom edge?  I can understand that using lower case letters would cause the problem but not capitals.

    Cheers,
    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    Hi, @owen_sparks,

    (1) I eventually want to sell this feature ( cheap, but not free)!  But don't worry, you get a free copy for helping contribute. I think this is a useful enough feature people would pay a couple of bucks to save time, and I doubt onshape will improve it because even many of their other competitors ( Fusion 360) do not do better at this.

    (2) You're not being thick, I need to do a better job defining terms. 'the bottom of the text' and 'the baseline' are not the same:  

    The highlighted areas are the issue.  In the curved text feature, when you select 'bottom', 'top', or 'middle', these refer to alignment relative to the sketch box, not the entire extents of the text.  By definition, the letters of text sometimes go below the baseline.

    All of the characters missing in the originally reported problem by @attila_balogh are those that happen to extend just a bit below the bottom of the sketch box, which in this use case was aligned to the selected baseline.

    It would be possible, but confusing to define 'bottom' to mean 'the bottom of all of the text'. Nearly nobody would want this in practice. Plus, even were that to be a feature, it would still be trivial to produce this same issue, for example by choosing to 'middle' align on a baseline too close to the edge of the surface.





  • attila_baloghattila_balogh Member Posts: 2
    @owen_sparks when you rebuilt it did you use a revolved surface as the start, rather than extruded? My hunch is that's the operative difference. 

    Underneath the hood, the curved text feature uses my other offset face feature to produce an offset surface. the offset algorithm is imperfect, due to limitations with onshape. ( which now that i think about it coudl have been remedied by now).  So sometimes that's the underlying problem. 

    @attila_balogh
     i'm going to have a look soon-- i'll get to the bottom of it.

    Hi Dave!

    Thank you taking time to clear this problem.
    I use the revolve feature to make this adapter ring originally.
    If you look on the sketch you can see other sketch parts too for revolve. Only on the upper part of this ring i like to be written.....
    So for me was easier to use revolve then extrude  more steps....
    This is the reason why i choose the revolve.

    Yes we as user should know the right naming , then we can focus on this problem with the characters more better.
    If i know then I push a little upper (as you making) but it can be little complex other people to understand this.
    Better is maybe with warning or pushing the whole text upper until it is no problem.....or as an option where the user can decide cut down the parts casing this problem or push up until no loss in characters..

    Sorry for my English, hope understand it correctly.

    Attila


  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    @attila_balogh , using the revolve function turned out not to be the issue-- it is the fact that the baseline is at the bottom. 

    Keep in mind that some letters will extend below the baseline you choose-- in this case, that means they land off of the surface of the ring.

    Just adjust the baseline to be a bit higher up and you'll be able to get the desired result. See the example document I linked-- i did it by making a new sketch about 1mm above the bottom, and making a new baseline around the ring there. 
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    @dave_cowden.  Hi Dave.  Thanks for the explanation, it's appreciated.

    (a) My understanding from the days of old was that Capitals never crossed the base line.  As such I consider the "J" issue above to be a naff font, not a naff featurescript.  Maybe new fangled capitals can cross.  If so I disapprove of such fonts.  When I rule the world I will ban them.

    (b) The "G" issue looks like a scaling factor.  OS problem perhaps, or naff font again? Perhaps as a user friendly workaround there could be another option to shrink the font by a tiny amount (or move up a smidgen) in an iterative loop, until no error is reported?

    (c) Offer of free feature sounds excellent, but not necessary.  Happy to learn stuff so don't mind fiddling with things.

    Cheers,

    Owen S. 
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    When I rule the world I will ban them.

    Ok @owen_sparks  +1 for making me laugh outloud.

    (b) i 2nd the idea of making it work somehow. Ideally, even when it doesnt work, it does something that makes it obvious to the user what correction is needed.  Your idea meets these criteria in the present use case. But it would not meet it if the baseline selected were, say, chosen to be 'middle' justified. Or if the user specifies a custom spacing that makes the letters spread out past the surface.

    Because there are so many ways the user could end up with text off surface, I feel like only two solutions really work:  (1), give an error, saying 'your text would end up off the surface. Try again', or (2) extend the surface in some way to make it work.

    Which of these two do you think you'd prefer? I can see pros and cons.  

  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    edited December 2016
    @dave_cowde, Hi Dave.  My preference would be with option (1).

    (a) I use the feature to put text on physical solid parts I've designed.  Say adding the Part Number or revision to a printed or CNC machined part. 

    So if I've called your FS in a way that results in the text missing the part then I need to move it to make sure it's on the part.  I'd almost certainly need to make the text fit the part not the other way around.  I'd never ever ever want a FS to change the core geometry of a part (especially in a small hard to spot way) without explicit instructions from me to do so. 

    Perhaps if the FS language were to support a little more interaction when the script runs, rather than just just a precondition, then there could be a big flashing warning box come up saying "This will alter your geometry, please click continue to accept this change or abort to go back to the beginning and change the text parameters."

    (b) Other people's use cases may vary.  I could imagine a case whereby a user wants to make a sign with a minimum font size on it and have the board it's mounted to scale to accommodate the letters.

    Dunno if that helps in the slightest. :p

    Cheers,

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    @owen_sparks  Thanks for the comments. I think you make a very good point about the dangers of extending the base surface.  Without the user knowing.

    I think I will go with an error message.
  • owen_sparksowen_sparks Member, Developers Posts: 2,660 PRO
    Hi @dave_cowden

    Thinking about this a little further I think it would be good if "Problematic" letters were to be extruded as a new part, and to a depth of 1mm (to get around the failure) and set to be red.  This way there would be a something to help the user visualise the problem.  Add in a descriptive error message and I rthink we'd be able to fix our mistakes without bugging you for help :-)

    Owen S.
    Business Systems and Configuration Controller
    HWM-Water Ltd
  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    @owen_sparks yes, that could work. Another idea I had was to extend a flat plane under each letter, and use that to allow the letter to work. As far as I know there is not a way to change the color programmatically.

    i'm like super-busy these days, but i can make these changes eventually.
  • dominic_brockhousedominic_brockhouse Member Posts: 1 EDU
    Hi there. I'm loving the curved text post-script and have been using it to create a personalised fidget spinner for my daughter. She wanted her name and her favourite pop stars engraved on the sides. All was going well with Eminem and Stormzy sitting on flat surfaces, but then the cursed Taylor Swift came along, with her O and S, cheekily sneaking below the baseline and prompting me to spend considerable time searching the web and finding this post. I am certainly no developer so know little about how to fix the problem (see pic), but would like to know if there is a solution in the pipeline. Is it possible to change the Baseline box to be a "reference" rather than a strict line the text must sit on? Or maybe add an "offset" feature whereby you can set a distance from the baseline for the text, e.g. above xxx mm / below xxx mm.
  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    Hi @dominic_brockhouse

    Thanks for reaching out! You've actually been very kind, in that you were willing to search and  recognize what's going on. Many users have been confused by the missing letters, and have not been able to deduce as you have that problem is due to the letters extending below the baseline. This is not the kind of experience i'm happy with, so I do plan to address the issue.  Time's been super hard to find during these last 5 months,though-- it is FIRST robotics season, and that's been taking most of my free time ( Go team 281! )

    My plan is to modify the feature to make the bottom ( or top) be the "real" top or bottom, not the baseline. I like your offset idea too, but not as a solution to the missing letters problem, unless it defaults to a value sufficient to prevent the issue.  I think there are probably lots of cases where that would save a step.

    Thanks for your patience- i'll get this fixed.


  • dave_cowdendave_cowden Member, Developers Posts: 465 ✭✭✭
    @dominic_brockhouse 

    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: 465 ✭✭✭
    edited May 2017
    @here, I have also upgraded upgraded the original file   to the new code. Existing users can simply upgrade to the newest version to get the newest code.
    Keep in mind that the inputs have changed slightly from the old version!


Sign In or Register to comment.