René's URL Explorer Experiment


Title: Feature Request: Some way to inline literal OpenSCAD code · Issue #178 · SolidCode/SolidPython · GitHub

Open Graph Title: Feature Request: Some way to inline literal OpenSCAD code · Issue #178 · SolidCode/SolidPython

X Title: Feature Request: Some way to inline literal OpenSCAD code · Issue #178 · SolidCode/SolidPython

Description: With the impending arrival (fingers crossed) of Customizer support for #61, some features of SolidPython won't play nicely with customizer values. For example: from solid import cube, scad_render_to_file from solid.utils import right fro...

Open Graph Description: With the impending arrival (fingers crossed) of Customizer support for #61, some features of SolidPython won't play nicely with customizer values. For example: from solid import cube, scad_render_t...

X Description: With the impending arrival (fingers crossed) of Customizer support for #61, some features of SolidPython won't play nicely with customizer values. For example: from solid import cube, scad_rend...

Opengraph URL: https://github.com/SolidCode/SolidPython/issues/178

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Feature Request: Some way to inline literal OpenSCAD code","articleBody":"With the impending arrival (fingers crossed) of Customizer support for #61, some features of SolidPython won't play nicely with customizer values. For example:\r\n\r\n``` python\r\nfrom solid import cube, scad_render_to_file\r\nfrom solid.utils import right\r\nfrom solid.customizer import CustomizerSliderFloat\r\nobject_count = CustomizerSlider('objects', 2, 1, 10, step=1)\r\nside = 2\r\nobjs = [right(2*i*side)(cube(side)) for i in range(object_count)] # we want this to use a reactive slider value but it can't :-/\r\nall_objs = union()(objs)\r\nscad_render_to_file(all_objs, 'customizer_fail.scad')\r\n\r\n```\r\n\r\nThis will create an OpenSCAD file with a slider, `objects` from 1 to 10. But, because the list comprehension (`objs = [right(...]`) happens only in Python code, the SCAD file will only use the initial value of the slider no matter how a user changes the slider in OpenSCAD. \r\n\r\nIf we want a row of cubes that reacts to the OpenSCAD slider, we need to run the object connection loop in OpenSCAD itself.  One way to do this would be a dedicated `scad_loop()` function we could add. But we might also add a `scad_inline()` function that would just paste an OpenSCAD string directly into the output `.scad` file without translating at all. That should make us able to use Customizer values anywhere, however we like. \r\n\r\nProposed fix: \r\n``` python\r\nfrom solid import cube, scad_render_to_file, scad_inline\r\nfrom solid.utils import right\r\nfrom solid.customizer import CustomizerSliderFloat\r\nobject_count = CustomizerSlider('objects', 2, 1, 10, step=1)\r\nside = 2\r\nobjs = scad_inline('''\r\nfor (i = [1:objects]){\r\n    translate([2*i*side,0,0]){\r\n        cube(side);\r\n    }\r\n}\r\n''')\r\n\r\nall_objs = union()(objs)\r\nscad_render_to_file(all_objs, 'customizer_fail.scad')\r\n\r\n```\r\n\r\nI'm not sure how I should build this yet, but I don't think it should take *too* much work\r\n\r\n\r\n","author":{"url":"https://github.com/etjones","@type":"Person","name":"etjones"},"datePublished":"2021-05-30T23:34:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/178/SolidPython/issues/178"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:0a641be1-c0c4-4fcd-e79c-653ee5714643
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idCC94:10503:68EA5A:86AF64:696AEA05
html-safe-nonce3866829ebaa5e8a98b6fb90cd7f840486ea142d8cc88585c0756e378dcf1ac8d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQzk0OjEwNTAzOjY4RUE1QTo4NkFGNjQ6Njk2QUVBMDUiLCJ2aXNpdG9yX2lkIjoiMzA2NDEyMjkxNDQ3NTAxMDU2NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacc4d19466f7d236543beed1ddcfe5bef5a2ac0931ff1a4e692f8598a5d56b760a
hovercard-subject-tagissue:906915153
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/SolidCode/SolidPython/178/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1caa38fe5a27d3e1577c11b2d2b8807d23f90828107318233c9645f25731ca1b/SolidCode/SolidPython/issues/178
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1caa38fe5a27d3e1577c11b2d2b8807d23f90828107318233c9645f25731ca1b/SolidCode/SolidPython/issues/178
og:image:altWith the impending arrival (fingers crossed) of Customizer support for #61, some features of SolidPython won't play nicely with customizer values. For example: from solid import cube, scad_render_t...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameetjones
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/SolidCode/SolidPython git https://github.com/SolidCode/SolidPython.git
octolytics-dimension-user_id622839
octolytics-dimension-user_loginSolidCode
octolytics-dimension-repository_id1377446
octolytics-dimension-repository_nwoSolidCode/SolidPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1377446
octolytics-dimension-repository_network_root_nwoSolidCode/SolidPython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/SolidCode/SolidPython/issues/178#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSolidCode%2FSolidPython%2Fissues%2F178
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FSolidCode%2FSolidPython%2Fissues%2F178
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=SolidCode%2FSolidPython
Reloadhttps://github.com/SolidCode/SolidPython/issues/178
Reloadhttps://github.com/SolidCode/SolidPython/issues/178
Reloadhttps://github.com/SolidCode/SolidPython/issues/178
SolidCode https://github.com/SolidCode
SolidPythonhttps://github.com/SolidCode/SolidPython
Notifications https://github.com/login?return_to=%2FSolidCode%2FSolidPython
Fork 189 https://github.com/login?return_to=%2FSolidCode%2FSolidPython
Star 1.2k https://github.com/login?return_to=%2FSolidCode%2FSolidPython
Code https://github.com/SolidCode/SolidPython
Issues 27 https://github.com/SolidCode/SolidPython/issues
Pull requests 6 https://github.com/SolidCode/SolidPython/pulls
Actions https://github.com/SolidCode/SolidPython/actions
Projects 0 https://github.com/SolidCode/SolidPython/projects
Wiki https://github.com/SolidCode/SolidPython/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/SolidCode/SolidPython/security
Please reload this pagehttps://github.com/SolidCode/SolidPython/issues/178
Insights https://github.com/SolidCode/SolidPython/pulse
Code https://github.com/SolidCode/SolidPython
Issues https://github.com/SolidCode/SolidPython/issues
Pull requests https://github.com/SolidCode/SolidPython/pulls
Actions https://github.com/SolidCode/SolidPython/actions
Projects https://github.com/SolidCode/SolidPython/projects
Wiki https://github.com/SolidCode/SolidPython/wiki
Security https://github.com/SolidCode/SolidPython/security
Insights https://github.com/SolidCode/SolidPython/pulse
New issuehttps://github.com/login?return_to=https://github.com/SolidCode/SolidPython/issues/178
New issuehttps://github.com/login?return_to=https://github.com/SolidCode/SolidPython/issues/178
Feature Request: Some way to inline literal OpenSCAD codehttps://github.com/SolidCode/SolidPython/issues/178#top
https://github.com/etjones
https://github.com/etjones
etjoneshttps://github.com/etjones
on May 30, 2021https://github.com/SolidCode/SolidPython/issues/178#issue-906915153
#61https://github.com/SolidCode/SolidPython/issues/61
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.